You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
See the $routeProvider config.
.when('/Feedback/Details/:id', { templateUrl: '/Feedback/Details/:id', controller: "TestRoute" })
I need to set id with template url dynamically. Is there any option? I do not want to do any Hack like creating a controller and set routeProvider or using ng-include.
Bellow is a option what we can think for parseRoute method. But i do not want to touch the library code.
function parseRoute() {
// Match a route
var params, match;
forEach(routes, function (route, path) {
if (!match && (params = switchRouteMatcher($location.path(), path))) {
match = inherit(route, {
params: extend({}, $location.search(), params),
pathParams: params
});
if ((route.templateUrl) && (/:/.test(route.templateUrl))) {
match.templateUrl = interpolate(route.templateUrl, params);
}
//remove cached template if params were substituted (rely on browser cache)
if (match.templateUrl != route.templateUrl) {
match.template = undefined;
}
match.$route = route;
}
});
// No route matched; fallback to "otherwise" route
return match || routes[null] && inherit(routes[null], { params: {}, pathParams: {} });
}
Activity
lrlopez commentedon Apr 4, 2013
It's already supported, kinda of. Have a look into #1849. This is available since 1.2.2.
sebfie commentedon Aug 6, 2013
Is it not 1.1.2 instead of 1.2.2 ?
lrlopez commentedon Aug 6, 2013
Yeah, it was a typo :) 1.1.2 should be ok...
Narretz commentedon Dec 19, 2013
@petebacondarwin this one can be closed too