[英]Using Angular timer in ionic3
我在ionic3中使用了角度計時器(即http://siddii.github.io/angular-timer/index.html#/markup5 ),但是當我將計時器標記放在html頁面中時,出現了錯誤。 不知道該怎么辦。
<timer end-time="{{timelimit.timeLimitDate}}">{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.</timer>
錯誤:
Unhandled Promise rejection: Template parse errors:
'timer' is not a known element:
1. If 'timer' is an Angular component, then verify that it is part of
this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("ate}}">{{days}} days, {{hours}} hours, {{minutes}} minutes, {{seconds}} seconds.</timer>-->
有人知道需要做什么,非常感謝〜
您不能將上述計時器與Ionic 3
一起使用,因為它使用AngularJS
。您需要為此找到一個Angular模塊。
我認為您可以在Ionic應用程序上使用此ng2-simple-timer模塊。
將SimpleTimer
添加到模塊提供程序(例如app.module.ts
)中。
import { SimpleTimer } from 'ng2-simple-timer';
@NgModule({
providers: [SimpleTimer]
})
更多信息在這里 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.