Angular SVG圆形进度条不适用于Ionic [英] Angular SVG round progressbar not work for Ionic

查看:554
本文介绍了Angular SVG圆形进度条不适用于Ionic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的离子项目读取并安装了 Angular SVG圆形进度条,但它对我不起作用,

https://github.com/crisbeto/angular-svg-round-progressbar

Im read and install this Angular SVG round progressbar for my ionic project , but its not working for me,
https://github.com/crisbeto/angular-svg-round-progressbar

如何正确添加此页面?请帮我修复此
显示此错误

how to correctly added for this my page? please help me to fix this displayed this error


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。 (

to suppress this message. 3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

  <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>

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'
});
  }

}


推荐答案

更新:您需要使用旧版本,如下所示。当前版本存在我在下面提到的问题。

Update: You need to use an older version as shown below.The current version has an issue where I have mentioned below.

npm install angular-svg-round-progressbar@1.1.1 --save

工作Git Repo就在这里

您只需将其添加到页面的模块中,如下所示。

You just need to add it to your page's module as shown below.

home.module.ts

import {RoundProgressModule} from 'angular-svg-round-progressbar';

@NgModule({
  declarations: [
    HomePage,
  ],
  imports: [
    IonicPageModule.forChild(HomePage),
    RoundProgressModule
  ],
})
export class HomePageModule { }

注意:

这个模块似乎有一个新问题。我已经记录了它。我们必须等到他们给出解决方案。 Git问题在这里

It seems to have a new issue with this module.I have logged it. We have to wait till they'll give the solution.Git issue is here.

这篇关于Angular SVG圆形进度条不适用于Ionic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆