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
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With