3

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.

Narendra
  • 4,514
  • 2
  • 21
  • 38

1 Answers1

0

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.
bracco23
  • 2,181
  • 10
  • 28