angularjs - Nativescript angular Cannot move app.component.html in to separte folder -
i using nativescript 2.3.0 angular. created starter project following command
tns create projname --ng
i have following folder structure
├── app │ ├── app.css │ ├── app.component.html │ ├── app.component.ts │ ├── main.ts
in side main.ts
file have following.
import { platformnativescriptdynamic, nativescriptmodule } "nativescript-angular/platform"; import { ngmodule } "@angular/core"; import { appcomponent } "./app.component"; @ngmodule({ declarations: [appcomponent], bootstrap: [appcomponent], imports: [nativescriptmodule] }) class appcomponentmodule {} platformnativescriptdynamic().bootstrapmodule(appcomponentmodule);
notice importing appcomponent
on line 3
what want want organize code have app.component
file in separate folder
as shown below
│ ├── pages │ │ └── app.component.ts │ │ └── app.component.html │ ├── app.css │ ├── main.ts
i have changed import
in main.ts
file follows
import { appcomponent } "./pages/app.component";
moving file app.component.html
file give following error.
unhandled exception com.tns.nativescriptexception: calling js method oncreateview failed
Comments
Post a Comment