I need to type in browse ...
domain.com.br/details1234
... and I need the controller to take this number 1234 and perform its task. I tried everything without success. Home
NOTE: If I create an anchor within the page by hrefing the route ( <a href="#/detalhes/1234">Rodar Controller</a>
) and clicking on this link, it works normally, but I need this to work by typing in the browse.
Here's my route and controller definition:
angular.module('confirmar.routers', ['ngRoute'])
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider
.when('/detalhes/:id', {
controller: 'DetalhesController'
})
.otherwise({redirectTo: '/'});
$locationProvider.html5Mode(true).hashPrefix('!');
}])
.controller('DetalhesController',['$routeParams', function ($routeParams) {
console.log('Detalhes exibido sobre o código: ' + $routeParams.id);
}]);
I need it to work by typing in the browse because the client will receive an email with the link: http://www.dominio.com.br/detalhes/<seu codigo>
and when he clicks on this link, he will open the browse displaying the details of the item <seu codigo>