不能绑定到 '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屋!