I'm working for the first time with Angular4. I noticed that I have 2 ways to get bundle files:
- ng save --open
- ng build
With the 2' option I'm able to take the bundle files and move it in my PHP project hosted with my Apache server etc... There are no problems with this procedure but is very very boring when you have to develop something.
Speaking instead about ng serve I noticed that Angular CLI create a NodeJS server listening on port 4200. And this mode is perfect to develop because Angular reloads the bundle files after every changes plus a lot of other useful things.
But there is a big problem: using NodeJS server I'm not able to integrate the PHP business logic at the boot of the site.
I'll explain: if I use the ng bundle I can copy-paste these files in my localhost/MyPhpProject/public/js for example. Then these files are imported with my index.php and everything works.
Instead with ng serve, Angular will use the file /MyAngularProject/src/index.html that is (in my case) totally useless and contains only a Hello World div.
So my question is: there is a way I can "configure ng serve" in order to use localhost/MyPhpProject/index.php inside my Apache server?
Many thanks!!