无法绑定到"thick",因为它不是"ng-progress"的已知属性 [英] Can't bind to 'thick' since it isn't a known property of 'ng-progress'
问题描述
我正尝试在我的应用中使用此插件: https://github.com/MurhafSousli/ngx-progressbar#用户内容自动加载栏
I am trying to use this plugin to my app: https://github.com/MurhafSousli/ngx-progressbar#user-content-automagic-loading-bar
它工作正常,但是当我对其进行测试时,它失败并显示错误:
Its working fine, but when I run test on it, it fails with error:
无法绑定到"thick",因为它不是"ng-progress"的已知属性.
Can't bind to 'thick' since it isn't a known property of 'ng-progress'.
app.module.ts
app.module.ts
import { NgProgressCustomBrowserXhr, NgProgressModule } from 'ngx-progressbar';
@NgModule({
declarations: [
AppComponent
],
imports: [
NgProgressModule
],
providers: [
{ provide: BrowserXhr, useClass: NgProgressCustomBrowserXhr },
],
bootstrap: [AppComponent]
})
export class AppModule {
}
我的app.component.html
My app.component.html
<ng-progress [thick]="'true'" [showSpinner]="'false'"></ng-progress>
当我跑步时 npm运行测试
When I run npm run test
它失败并显示错误:
错误:模板解析错误: 1.如果"ng-progress"是Angular组件,请确认它是该模块的一部分.
Error: Template parse errors: 1. If 'ng-progress' is an Angular component, then verify that it is part of this module.
我完全不知道为什么测试只会失败.
I am completely clueless why Test is only failing.
推荐答案
就像我在评论中说的那样,您忘记在测试中提供组件了.
Like I said in the comment, you forget to provide your component in your test.
这篇关于无法绑定到"thick",因为它不是"ng-progress"的已知属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!