https://github.com/wellwind/nativescriptpractice
https://github.com/wellwind/nativescriptpractice
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/wellwind/nativescriptpractice
- Owner: wellwind
- Created: 2017-02-28T12:23:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T12:30:15.000Z (over 9 years ago)
- Last Synced: 2024-10-12T06:08:21.762Z (over 1 year ago)
- Language: TypeScript
- Size: 8.61 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NativeScriptWithNgCli
The [NativeScript](http://docs.nativescript.org/) project but you can use [Angular CLI](https://github.com/angular/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
```
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](http://docs.nativescript.org/ui/basics) 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.
```typescript
@Component({
moduleId: module.id,
selector: "app-test",
templateUrl: "./test.component.html"
})
export class TestComponent implements OnInit {
}
```