The NativeScript core team works with the Angular team at Google to ensure NativeScript and Angular are seamlessly integrated. If you know Angular, you’re already ready to develop amazing native mobile apps with NativeScript. With NativeScript and Angular, a single code base (and skillset) can be used to create web apps and native mobile apps with 100% native performance and power. Buttery smooth animations, direct access to 100% of the native platform APIs, it’s pretty amazing.
One skillset. One code base. Three platforms: iOS, Android, and Web.
Learn more on the Angular blog.
Using Angular with NativeScript is a snap. From your terminal or command line, just start a new project with this command:
$ tns create my-angular-app --ng
This will create a new NativeScript project with all of the necessary Angular files, folders and settings ready to go. By default, Angular projects use TypeScript, so NativeScript will also handle all of the TypeScript setup and configuration. Learn more about NativeScript and TypeScript.
Once you’ve got your project, it’s time to build your native mobile app! Use these resources to get started quickly:
Angular provides all of the plumbing necessary to create high quality, highly maintainable NativeScript apps. Reuse Angular concepts such as data binding, dependency injection, services, and routing to build native mobile apps.
Tap into the huge Angular developer community, more than 1 million strong, to get extra help, training and reusable code that can be directly applied to NativeScript mobile projects. NativeScript is the way for Angular developers to create native mobile apps.
When starting a new NativeScript Angular project, make sure to use the -ng flag to get the skeleton code.
In your views, do not use self-closing XML like
<Label [text]="binding" />. Instead close all elements with a discrete closing tag:
If you're planning to add NativeScript to an existing Angular "web" codebase, keep in mind window does not exist in NativeScript, therefore ensure to remove any explicit dependencies on the browser's global window object in your code.
Find code samples for common app scenarios on the NativeScript Marketplace.
Remember, there is no DOM in NativeScript, so separate layout from business logic for maximal reuse.
We have an entire documentation section on sharing code between web and native apps with Angular. Check it out here.