We have a responsive web app developed using AngularJS 2. We would like to wrap it inside a package to redistribute it as a mobile app. Android is our priority. We have look
Ionic 2, currently in beta, uses Angular2 to make hybrid mobile apps. You'll have to make some modifications in your app but it's still Angular2, only with some custom ionic components.
NativeScript also uses Angular2 to make apps, but this time, it makes true native apps. There's a little bit more of work there, you'll have to adapt your templates and styles but the code is still Angular2-flavored TypeScript.
Jan 2019, I am looking for similar for a personal project, I know Angular 7, want to convert it to Android/iOS app.
Found below 4 months back old article, published on Angular.io blog.
It talks about NativeScript
, developed by the Progress software company, it supports Js, or Ts, or Angular+Ts projects.
Same Angular 2+ projects can be converted to mobile, using code sharing:
*.tns.*
files like mycomp.html, mycomp.ts, mycomp.css (the usual files)*.tns.*
/native script files, like mycomp.tns.html, mycomp.tns.ts, mycomp.tns.css*.tns.*
) then they overwrite on web files (non *.tns.*
), in the build process, while building the bundle for mobile (android/ios)*.tns.*
) become the mobile files, hence the code sharing.
I am half way through reading but it already looks like NativeScript, which is in collaboration with angular, is a great way to go ahead.
Read below to know more.
This one looks more promising angular-native-seed, where you only need to write code once.
You can use Cordova with very minimal number of steps.
This link will be helpful. It worked for me.
You can also use Ionic but it was throwing router error and also the project structure was different. So you should have new project with Ionic router and then selectively copy the angular code. Where as in cordova, you can have a project with basic cordova set up and copy entire code at once with minimal config changes.