Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

This question is regarding best practices and application architecture for Laravel 4 and AngularJS

Is it advisable to create an RESTful application in Laravel 4 that serves a blade template for each "section" or "area" of the application and provides and API to access RESTful JSON data within these areas calling AngularJS pratials. Or is it better to serve as a single page AngularJS application.

A better description would be calling a "DashbaordController@get" controller method and serving a larvel blade template from here. then the rest of the dashboard "area" is handled by AngularJS and its partial templates through a RESTful JSON API in the DashboardController.

share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

up vote 0 down vote accepted

It all depends on what you want to do.

SPA: You could create a master.blade.php and use angulars routing. This way you only need to specify the resource in laravel and call it inside angular.

Not spa: Use laravel to create the routes and let laravel create the views. You only need to create different view templates, which hold references to your angular controllers.

Partial SPA: You could route everything past domain.com/admin through angular.

share|improve this answer
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.