E
E
enchikiben2018-09-27 14:25:59
Angular
enchikiben, 2018-09-27 14:25:59

How to create an Angular 6 npm package?

Good afternoon! Tell me who came across how to create a library package? I try to create on the dock https://github.com/angular/angular-cli/wiki/storie... and everything seems to work, but as soon as I add ngClass for example: the library is being built, but when it is imported, an error occurs:
<div [ngClass]="'test'">test</div>

ERROR Error: StaticInjectorError(AppModule)[NgClass -> KeyValueDiffers]: 
  StaticInjectorError(Platform: core)[NgClass -> KeyValueDiffers]: 
    NullInjectorError: No provider for KeyValueDiffers!
    at NullInjector.get (core.js:1233)
    at resolveToken (core.js:1540)
    at tryResolveToken (core.js:1471)
    at StaticInjector.get (core.js:1333)
    at resolveToken (core.js:1540)
    at tryResolveToken (core.js:1471)
    at StaticInjector.get (core.js:1333)
    at resolveNgModuleDep (core.js:10291)
    at NgModuleRef_.get (core.js:11376)
    at resolveDep (core.js:11868)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-09-27
@sidni

maybe so
[ngClass]="{'test':true}"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question