Mina Ashraf Zaki
Mina Ashraf Zaki

Reputation: 51

How to convert existing NativeScript Angular project to Code Sharing project

All available tutorials talk about converting Angular Web Apps to codesharing Nativescript projects. I want to do the opposite.

I almost finished coding the mobile app with Nativescript and now I wanna make the Web App with the code sharing in between both.

Upvotes: 3

Views: 282

Answers (1)

bracco23
bracco23

Reputation: 2221

I did almost the same a couple of days ago, and while not exactly standard, my approach has been:

  • create a new shared web/mobile project from scratch.
  • move angular components from the mobile-only project to the shared project.
  • rename all HTML files to .tns.html ( probably you should rename SCSS/CSS files too, I didn't have any)
  • create empty HTML files for each component you have added
  • adapt app.module.ts and app.module.tns.ts to include the new components and any service. app.module.tns.ts should very closely resemble the one of the mobile-only app.
  • build and resolve errors when they appear. If possible, keep webpack watch files for both mobile and web build, so that you can resolve errors for both platforms.

Upvotes: 0

Related Questions