模块'AppModule'导入的意外值'RoundProgressModule'。请添加@NgModule注释

时间:2017-09-04 06:18:19

标签: angular webpack-3 typescript2.4

将包从angular4更新为angular5.0和angular-svg-round-progressbar1.2.0之后。它在浏览器控制台中抛出错误

模块'AppModule'导入的意外值'RoundProgressModule'。
请添加@NgModule注释

见下面的代码:

html的

 <round-progress [color]="'orange'"
                        [current]="idleCountdown" [max]="100" [radius]="50"></round-progress>

.TS

@Component({
    templateUrl: './dashboard.component.html',
    styleUrls: [],
    encapsulation: ViewEncapsulation.None,
})
export class DashBoard implements OnInit {
 Countdown: number;

  ngOnInit() {

  this.idleCountdown = 40;
  }    
}

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { MaterialModule } from '@angular/material';  
import { RoundProgressModule } from 'angular-svg-round-progressbar';

import { AppComponent } from './app.component';
import { routing } from './app.routing';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        RouterModule,
        MaterialModule,
        RoundProgressModule
        ],
    declarations: [
        AppComponent,
        ], 
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }

Packages.json

 "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/cdk": "^5.0.0-rc0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/material": "^5.0.0-rc0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/platform-server": "^5.0.0",
    "@angular/router": "^5.0.0",
    "angular-svg-round-progressbar": "^1.2.0"
    }

0 个答案:

没有答案