3

将包从 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 { }

包.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"
    }
4

0 回答 0