NativeScript With Angular CLI - Seed project

April 6, 2017 ยท View on GitHub

The NativeScript project but you can use Angular CLI to generate component.

Usage

git clone https://github.com/wellwind/native-script-with-ng-cli.git
cd native-script-with-ng-cli
npm install
npm run start.android
npm run start.ios

You will see a very simple NativeScript app.

Using Angular CLI to generate component

ng g c test

The command will generate a component in src\app\test. You have to use NativeScript UI on *.html file.

NativeScript use absolute view path for templateUrl in @Component, to enable relative path, you have to add moduleId: module.id to @Component() decorator.

@Component({
    moduleId: module.id,
    selector: "app-test",
    templateUrl: "./test.component.html"
})
export class TestComponent implements OnInit {
}