I have a demo site running on Laravel as Back-end and Jquery on front and was attempting to migrate Jquery to Angular JS. I was trying to achieve this using Laravel as routing and as a service for AngularJS. But this way I can't get variables on through URI on Angular (at least I couldn't find any way). Example:
Angular Controller:
app.controller('estudioPerfilCtrl', function($scope, uiGmapGoogleMapApi, estudioService) {
$scope.loading = true;
//Issue here, getEdit(1) to get data from id = 1, need to get URI variable value
estudioService.getEdit(1).then(function(response) {...}
Laravel Routing
Route::group(array('prefix' => 'estudio'), function(){
//auth
Route::group(array('middleware' => 'auth'), function(){
Route::group(array('prefix' => 'ajax'), function(){
Route::get ('{id}/edit', 'Estudio\PerfilController@editAjax');
});
Route::get ('{id}/edit', 'Estudio\PerfilController@edit');
The /ajax/edit route feeds data to Angular Service, and the /edit loads Laravel view, that calls Angular Controller.
Should I migrate all routing to AngularJS? Or is there a work around for my problem?