I have the following angular route structure:
.when('/', {
redirectTo: '/pages/signin'
})
.when('/:page', { // we can enable ngAnimate and implement the fix here, but it's a bit laggy
templateUrl: function($routeParams) {
return 'app/views/pages/'+ $routeParams.page +'.html';
},
resolve: function($routeParams) {
return {deps: app.resolveScriptDeps(['js/controller.'+$routeParams.page+'.js'])};
},
controller: 'Dash'
})
It works great, finds the html files according to what is in the URL
In my route.php file, I have this route:
Route::controller('api/usuarios', 'UsuariosController');
In UsersController I have the following method:
public function getDados(){
return Response::json([
'id' => '1',
'texto' => 'TESTE TESTE ETSTE'
]);
}
In my angle controller, I have this method:
$scope.getDados = function(){
$http.get('api/usuarios/dados').
success(function(data, status, headers, config) {
console.log('DATA', data);
}).
error(function(data) {
});
}
$scope.getDados();
But when I call this angle method, it gives me a 404 error
Any tips on what might be happening?