Return to site
· Web Applications,Laravel,AngularJS,Web Development
broken image

When you are into Laravel and you want to use angular.js. To build the logic correct it should have a

good application structure. Angular views are stored in the public folder. There are two ways to combine

angular and Laravel.

Client side rendering.

Use Laravel as API end point. It will return JSON. Angular will query this data through its $http or

$resource service and compile the templates.

Server and Client side rendering

In this way Laravel would do the routing and compile some templates on the server-side. Angular would

be used only for some interactions on the site. The benefit of this method is the performance since all

the HTML is given to the user the first time they visits the site.

You should write only a single page application in-order to benefit the features of angular. The applications that you write should be decoupled ie the client side angular application and server side web API.Read more