问题
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:
Can't bind to 'thick' since it isn't a known property of 'ng-progress'.
app.module.ts
import { NgProgressCustomBrowserXhr, NgProgressModule } from 'ngx-progressbar';
@NgModule({
declarations: [
AppComponent
],
imports: [
NgProgressModule
],
providers: [
{ provide: BrowserXhr, useClass: NgProgressCustomBrowserXhr },
],
bootstrap: [AppComponent]
})
export class AppModule {
}
My app.component.html
<ng-progress [thick]="'true'" [showSpinner]="'false'"></ng-progress>
When I run npm run test
it fails with error:
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.
回答1:
Like I said in the comment, you forget to provide your component in your test.
来源:https://stackoverflow.com/questions/43996803/cant-bind-to-thick-since-it-isnt-a-known-property-of-ng-progress