mk_yo
mk_yo

Reputation: 780

angularjs routes parameters issue

How I can get parameter from such url in angularjs controller:

http://localhost:53315/Employee/{parameter}#/info

Here's my angularjs code:

    $routeProvider
 .when('/info', {
            controller: 'UserCtrl',
            templateUrl: baseTemplateUrl + 'info.html'
        });
.controller('UserCtrl', ['$rootScope', '$scope', '$location', '$routeParams', 'User', function ($rootScope, $scope, $location, $routeParams, User) {
    $rootScope.user = User.get({ id: $routeParams.id });

Thank you in advance for any help!

Upvotes: 0

Views: 60

Answers (1)

Fordio
Fordio

Reputation: 3820

I think you'll have to parse $location.absUrl() to get it.

Upvotes: 3

Related Questions