Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert an existing Angular 2 web app into a native script application

For about a year now i have been working on an Angular 2 web app as a hobby and have now at a point where I can start testing. I was wondering how i can use my existing angular 2 code and convert it over to a native script application. I have been looking into native script it looks like you have to be using native script from the start. I am also using The Angular cli and several npm packages to aid in the development of my app.

edited

like image 325
Adam Saunier Avatar asked Jul 24 '17 01:07

Adam Saunier


2 Answers

UPDATE:

The Angular CLI now has support since v6 for NativeScript which is pretty awesome.

Check out this link to get started: https://docs.nativescript.org/code-sharing/intro

ORIGINAL: You can re-use most of your scripts but the templates and some of the styling must change since there's no support for HTML as well as some CSS properties not being available.

There is a way to share codebase without having to create a separate project however with a module called nativescript-ngx-magic, you can take a look at it here:

https://github.com/wwwalkerrun/nativescript-ngx-magic

Basically what it does is it allows you to have a native version and a normal web version in the same project and it'll automatically switch templates for you.

like image 179
Chrillewoodz Avatar answered Sep 28 '22 15:09

Chrillewoodz


you can use certain git repos for doing this but the best and practical is to follow the documentation which will take you through all the processes in converting to nativescripts. Follow this doc link https://docs.nativescript.org/angular/tutorial/ng-chapter-0

like image 38
Kofi Sammie Avatar answered Sep 28 '22 17:09

Kofi Sammie