我在尝试安装 angular2 moment 时遇到错误
I'm getting errors trying to install angular2 moment
此处的说明对我不起作用:
https://github.com/urish/angular2-moment
我做到了
npm install --save angular2-moment
工作正常,然后我尝试这样做:
typings install --save moment
但出现 typings: command not found
错误,然后我在我的 app.module.ts
文件中进行了导入:
import { MomentModule } from 'angular2-moment';
将其包含在我的模块声明和入口组件数组中,
运行 构建并得到:
"Error: Unexpected module 'MomentModule' declared by the module 'AppModule' "
import { BrowserModule } from '@angular/platform-browser';
import {MomentModule} from 'angular2-moment';
@NgModule({
declarations:[/**...**/]
imports: [BrowserModule,MomentModule], // did you update this line this works for me
bootstrap: [AppComponent],
providers:[
/**
...
**/
]
})
这有效检查这个 link https://github.com/rahulrsingh09/AngularConcepts/blob/master/src/app/app.module.ts 第 115 行
此处的说明对我不起作用:
https://github.com/urish/angular2-moment
我做到了
npm install --save angular2-moment
工作正常,然后我尝试这样做:
typings install --save moment
但出现 typings: command not found
错误,然后我在我的 app.module.ts
文件中进行了导入:
import { MomentModule } from 'angular2-moment';
将其包含在我的模块声明和入口组件数组中, 运行 构建并得到:
"Error: Unexpected module 'MomentModule' declared by the module 'AppModule' "
import { BrowserModule } from '@angular/platform-browser';
import {MomentModule} from 'angular2-moment';
@NgModule({
declarations:[/**...**/]
imports: [BrowserModule,MomentModule], // did you update this line this works for me
bootstrap: [AppComponent],
providers:[
/**
...
**/
]
})
这有效检查这个 link https://github.com/rahulrsingh09/AngularConcepts/blob/master/src/app/app.module.ts 第 115 行