cor*_*114 7 typescript ionic-framework ionic2 ionic3 angular
我Angular SVG round progressbar为我的离子项目阅读并安装了这个,但它对我不起作用,
https://github.com/crisbeto/angular-svg-round-progressbar
如何正确添加此页面?请帮我解决这个显示此错误
Run Code Online (Sandbox Code Playgroud)Error: Template parse errors: Can't bind to 'current' since it isn't a known property of 'round-progress'. 1. If 'round-progress' is an Angular component and it has 'current' input, then verify that it is part of this module. 2. If 'round-progress' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component压制此消息.3.要允许任何属性将"NO_ERRORS_SCHEMA"添加到此组件的"@NgModule.schemas".("
Run Code Online (Sandbox Code Playgroud)<round-progress [ERROR ->][current]="48" [max]="100"></round-progress> </ion-content> ")
谢谢
我的页面为我添加了home.html
<round-progress
[current]="current"
[max]="max"
[color]="'#45ccce'"
[background]="'#eaeaea'"
[radius]="125"
[stroke]="20"
[semicircle]="true"
[rounded]="true"
[clockwise]="false"
[responsive]="false"
[duration]="800"
[animation]="'easeInOutQuart'"
[animationDelay]="0"
(onRender)="doSomethingWithCurrentValue($event)"></round-progress>
Run Code Online (Sandbox Code Playgroud)
home.ts
import { Component,NgModule } from '@angular/core';
import {RoundProgressModule} from 'angular-svg-round-progressbar';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html',
})
@NgModule({
imports: [RoundProgressModule]
})
export class HomePage {
constructor(public navCtrl: NavController,private _config: RoundProgressConfig) {
_config.setDefaults({
color: '#f00',
background: '#0f0'
});
}
}
Run Code Online (Sandbox Code Playgroud)
更新:您需要使用如下所示的旧版本。当前版本存在我在下面提到的问题。
npm install angular-svg-round-progressbar@1.1.1 --save
Run Code Online (Sandbox Code Playgroud)
您只需将其添加到页面的模块中,如下所示。
home.module.ts
import {RoundProgressModule} from 'angular-svg-round-progressbar';
@NgModule({
declarations: [
HomePage,
],
imports: [
IonicPageModule.forChild(HomePage),
RoundProgressModule
],
})
export class HomePageModule { }
Run Code Online (Sandbox Code Playgroud)
笔记:
这个模块似乎有一个新问题。我已经记录了它。我们必须等到他们给出解决方案。Git问题就在这里。
| 归档时间: |
|
| 查看次数: |
5421 次 |
| 最近记录: |