passing parameters to dynamic templateurl

287 views Asked by At

Assume of all pre-requisites done e.g. adding links at the load of html. I have and angularjs posting call as

$location.path('/url1');

this goes to $routeProvider

$routeProvider.when('/url1', {
    templateUrl: '/public/url1.html/
})

above angularjs dynamic template loading works properly, now when i want to pass parameter then it does not work below

$location.path('/url1/:_id');

$routeProvider.when('/url1/:_id', {
    templateUrl: function(params) {
        return '/url1' + params._id + '.html';
    }
})

but i receive no parameterised url , so that i can access the parameters after posting.

0

There are 0 answers