Akash Agrawal
Akash Agrawal

Reputation: 2299

Sharing same code base for Web (Angular 4) and Mobile (Ionic 3)

I am curious to know if I can use the same code base for my web application which is already built in Angular 4 and mobile application (needs to be developed in Ionic 3).

Firstly, I've no prior knowledge of Ionic 3. So, I was checking the Ionic 3 documentation and got to know that I'll have to update the normal HTML tags with Ionic tags (ion-).

So, what I want to confirm is after updating the HTML tags, can I use the updated code for the web as well? Will it work the way it's working now? If yes, then is it a good practice to do so?

What will be the Pros and Cons of sharing the same code base?

Upvotes: 2

Views: 1140

Answers (1)

Sampath
Sampath

Reputation: 65860

You cannot do that. But you can develop web applications (PWA-progressive web apps) using Ionic. That is the only way where you can use the same code base.other way around it won't work. But you can use most of the Angular components within Ionic 3 projects.

But if you need to develop native Ionic app then you have to use native(iOS & Android) Cordova plugins. Most of those plugins are not working with web apps.

So if you need to use the same code base then you need to develop PWA app with ionic. That is the only way I can think of.

Upvotes: 3

Related Questions