.net core - Working with imports with split app modules in Angular(4) (client, server, shared) -
i created .net spa application angular front end using yeoman generator. creates app 3 app.module.ts files (app.module.client.ts, app.module.shared.ts, app.module.server.ts). unfortunately ngmodule imports located in client app module file not seem injected components. when try use ngfor on input given error "can't bind 'ngmodel' since isn't known property of 'input'." think because forms module not being imported though app.module.client.ts file looks this: import { ngmodule } '@angular/core';
import { browsermodule } '@angular/platform-browser'; import { formsmodule } '@angular/forms'; import { httpmodule } '@angular/http'; import { sharedconfig } './app.module.shared'; import {selectmodule} 'ng2-select'; @ngmodule({ bootstrap: sharedconfig.bootstrap, declarations: sharedconfig.declarations, imports: [ browsermodule, formsmodule, httpmodule, selectmodule, ...sharedconfig.imports ], providers: [ { provide: 'origin_url', usevalue: location.origin } ] }) export class appmodule { }
perhaps i'm missing on how these divided modules work. how import modules given different module architecture?
update: able solve problem including module imports in app.module.server.ts well. want leave question open , can explain how works. it's strange since prebuilt template yeoman has module imports in app.module.client.ts file , seem impotent when running website dotnet run
had duplicated in server file well.
Comments
Post a Comment