Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 + angular-cli + Laravel 5.3

Using latest angular-cli, I created new project and everything works fine. Next, I tried to integrate it in Laravel 5.3. I have this project working with systemjs, but I want to switch to webpack and to take advantage of angular-cli.

Problem is that in angular-cli.json I can't specify that index is index.php, it only accepts HTML.

Basically, I can't start the Angular application at all with this setup.

How can I overcome this?

like image 421
paradox37 Avatar asked Sep 17 '16 20:09

paradox37


2 Answers

In the end I separated Laravel and Angular 2, as Cristian Sepulveda wrote in the comment. This is the recommended approach anyway.

I make API with Laravel and use it with Angular 2.

like image 152
paradox37 Avatar answered Oct 24 '22 15:10

paradox37


In my case I serve the angular app from laravel. I still use webpack to build my assets but have a gulp task which copies the angular index.html to be index.blade.php of which the laravel app serves. I also use gulp to copy the built files from /dist to /public

like image 26
S.. Avatar answered Oct 24 '22 13:10

S..