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

2

5

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

Septum answered 24/7, 2017 at 1:38 Comment(2)
I haven't done it that way, but this seed project is setup very well for code sharing across web and mobile github.com/TeamMaestro/angular-native-seed maybe it will help.Bahadur
I think this is going in the wrong direction. I have been building an angular 2 web app and I want to convert that over to a native script application and so far it looks like I will have to reconstruct the app for a native script environment and have a second version for a web app environment.Septum
C
6

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.

Calais answered 24/7, 2017 at 6:39 Comment(0)
H
1

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

Hyperextension answered 15/12, 2017 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.