Skip to content

Commit 5adb172

Browse files
committed
Update the README
1 parent 2e701b6 commit 5adb172

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

README.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ The project bundles the NativeScript modules and Angular as source code dependen
1010
$ git submodule update --init
1111
```
1212

13+
# Prerequisites
14+
15+
Install your native toolchain and NativeScript as described in the docs:
16+
17+
https://docs.nativescript.org/setup/quick-setup
18+
19+
1320
## Install dependencies
1421

1522
```
1623
$ npm install -g grunt-cli
17-
$ npm install -g tsd
18-
$ npm install -g nativescript
1924
```
2025

21-
You may need to configure your `tsd` GitHub access token to avoid rate-limit-related download errors. See the token installation instructions in the `.tsdrc` section [here](https://github.com/DefinitelyTyped/tsd#tsdrc).
22-
23-
You will also need the [Android SDK](https://developer.android.com/sdk/) to build this project. Install it manually before continuing with the next steps.
24-
25-
Then install the NativeScript tools according to: [this article](http://docs.nativescript.org/setup/quick-setup).
26-
2726
Then install the needed NPM packages:
2827

2928
```
@@ -33,56 +32,48 @@ $ npm install
3332
## Compile and prepare NativeScript and Angular
3433

3534
```
36-
$ (cd deps/angular/modules/angular2 && tsd reinstall)
3735
$ grunt prepare
3836
```
3937

4038
## Initialize the test NativeScript app (ng-sample)
4139

4240
```
43-
$ grunt shell:ngSampleInit
41+
$ cd ng-sample
42+
$ grunt prepare
4443
```
4544

46-
## Compile the app and update its `./src` dir:
45+
The latter installs the `angular2` and `tns-core-modules` packages that you just built by running `grunt prepare` step in the project root.
46+
47+
## Compile the ng-sample app
4748

4849
```
49-
$ grunt ng-sample
50+
$ grunt app
5051
```
5152

5253
# Developer workflow:
5354

54-
1. Make some changes to the app or `src/nativescript-angular`
55-
2. Navigate to the ng-sample subdir: `$ cd ng-sample`
55+
1. Make changes to `src/nativescript-angular`, and rebuild with `grunt build`. If succesful, you should get a npm package in the project root.
56+
2. Navigate to the ng-sample subdir: `$ cd ng-sample`. Make some changes to the app or `../src/nativescript-angular`.
5657
2. Compile app: `$ grunt app`
57-
3. Run in emulator `$ tns emulate android --avd <YOUR-AVD>`
58+
3. Run with `$ tns run android` or `$ tns run ios`
5859

5960
Protip: combine #2 and #3 above in a single command run from the project root directory (works only on Unixy shells):
6061

6162
```
62-
$ (cd ng-sample && grunt app && tns emulate android --avd nexus4-x64)
63+
$ grunt app && tns run android
6364
```
6465

6566
On Windows, you can wrap those commands in a BAT file.
6667

67-
# Finding your way around
68-
69-
1. The `./src/nativescript-angular` folder holds the integration source code.
70-
2. The sample app below `ng-sample` is assembled by copying typescript dependencies in its `src` folder:
71-
* angular2 source code
72-
* nativescript-angular code
73-
* NativeScript typings: typings/nativescript
74-
3. All required JavaScript packages (including compiled NativeScript modules) are copied to `ng-sample/app/tns_modules`
75-
76-
# How the integration code works
77-
78-
1. Use the Angular Parse5DomAdapter to parse component markup.
79-
2. Provide a custom renderer (`NativeScriptRenderer`) that works with the parsed DOM and creates NativeScript UI elements. Only limited number of visual elements supported so far.
68+
Note that you should never change files in `ng-sample/src/nativescript-angular/` as they are overwritten with the reference sources in `src/nativescript-angular` on every `grunt app` run.
8069

8170
# Watch the video explaining Angular 2 and NativeScript
8271
[NativeScript session on AngularConnect conference](https://www.youtube.com/watch?v=4SbiiyRSIwo)
8372

8473
# Explore the examples
8574

75+
The `ng-sample` app is meant for testing stuff while developing the renderer code, and isn't the best example out there. You can take a look at these sample apps that use the published builds from npm:
76+
8677
* [Hello world starter](https://github.com/NativeScript/template-hello-world-ng)
8778
* [TodoMVC sample implementation](https://github.com/NativeScript/sample-ng-todomvc)
8879

@@ -91,4 +82,3 @@ On Windows, you can wrap those commands in a BAT file.
9182
1. There are certain issues with the Parse5DomAdapter and we'll likely need to provide our own later on:
9283
* Element and attribute names always get lowercased.
9384
* Self-closing elements (`<Label text="Name" /><Button text="Save" />`) get parsed wrong (in this case Button gets parsed as a Label child.
94-
2. The renderer implementation is by no means complete: we are still need to support view (de)hydration, DOM text updates, event dispatching, actions, etc.

0 commit comments

Comments
 (0)