(Angular 2+) Loading modules from outside the main.ts directory throws "Please add @NgModule annotation" error -
i'm having issue loading module lives outside node_modules directory.
this directory structure works:
+ node_modules + resources +--- app +------- main.ts +------- components +------- modules +----------- b.module.ts +----------- a.module.ts
this works:
+ node_modules + b.module.ts + resources +--- app +------- main.ts +------- components +------- modules +----------- a.module.ts
but throws "please add @ngmodule annotation" error, though b.module.ts have @ngmodule annotation , works in 2 directory structures above. should work @ all?
+ bmodule +---- b.module.ts + myapp +---- node_modules +---- resources +------- app +----------- main.ts +----------- components +----------- modules +--------------- b.module.ts +--------------- a.module.ts
i'm wondering if need make separate library this: https://hackernoon.com/how-to-create-library-in-angular-2-and-publish-to-npm-from-scratch-f2b1272d6266
edit: after more debugging found app using browserify in gulp, , not including contents of b.module.ts in output js bundle file.
Comments
Post a Comment