无法在Angular-2中设置环境常量变量

时间:2017-02-02 10:44:05

标签: angular

我已经完成了

export const environment = {
  production: false,
  serviceURL: 'url'
}; --> in environments/environment.ts

import { environment } from '../environments/environment';
serviceURL: environment.serviceURL;  --> in app.component.ts

但我收到错误

src / app / app.component.ts(17,22):找不到命名空间'环境'

My Project structure is attached.

1 个答案:

答案 0 :(得分:2)

我认为你的意思是:

serviceURL = environment.serviceURL;

=代替: