0

I have the following route config...

angular.module('ng').
        config(function ($routeProvider) {
            $routeProvider.
                when('/User_View/:username', { templateUrl: '/rest/tbot/run/User_View' })})
});

How do I pass the :username parameter to the server?

So the server receives the following request if the username is, e.g 'admin'...

/rest/tbot/run/User_View?userName=admin

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
  • 2
    The answer can be found here... http://stackoverflow.com/a/15817458/221683 – Ian Warburton Jul 14 '13 at 16:11
  • possible duplicate of [AngularJS - How to use $routeParams in generating the templateUrl?](http://stackoverflow.com/questions/11534710/angularjs-how-to-use-routeparams-in-generating-the-templateurl) – marko Jul 14 '13 at 20:17
  • I'd submit that if you're having the server render any html at all, you're probably doing Angular wrong. You should be securing *data* at the server, not *html*. Don't want to show the user something? Don't send the data back for it. – Ben Lesh Jul 15 '13 at 04:34
  • I'm working on a retrofit at the moment. That's why I needed to do this. ;) But still, it seems a bit silly to start pretending that the server doesn't exist. – Ian Warburton Jul 15 '13 at 08:16

0 Answers0