0

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!

2
  • Are you using any sever side framework for building the URL shown above? Commented Oct 14, 2014 at 15:47
  • yep. I m using asp.net mvc. <a href="/Organization/Employee/@user.Alias#info">@user.Alias.ToUpper()</a> Commented Oct 15, 2014 at 6:31

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.