Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create ionic 4 app inside Angular CLI projects structure

I am looking for a way to “ionic start” a project and having it in the projects folder of an existing Angular CLI solution (containing a web app and a lib already).

like image 784
LDEX Avatar asked Mar 25 '19 01:03

LDEX


2 Answers

So there isn't an official ionic cli command that can do this, but you can do

ng add @ionic/angular

In the Project and it will add the necessary pieces to the web app for you.

Other than that, there's always the manual way of installing ionic/angular

  • npm install @ionic/angular
  • npm install @ionic/angular-toolkit
  • add the styles listed here in your styles array
  • include the ionicons assets listed here
  • add the native build tasks listed here. This is optional if you're planning on deploying to native iOS and native android
like image 142
mhartington Avatar answered Oct 23 '22 10:10

mhartington


Thank you for the putting us to right path!

Small issue I ran into was: when I ran ng add @ionic/angular, it installed version 0.2.2 and was throwing the following error

The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.

I had to run ng add @ionic/[email protected] to make it work

like image 44
keeterDev Avatar answered Oct 23 '22 11:10

keeterDev