It's probably bad practice to have two separate routes point to the same state, but nothing is keeping you from creating two different states that use the same resolutions/controller/template.
$stateProvider
.state('state1', {
url: "/:city/events/:id",
templateUrl: "partials/events.html",
controller: eventsCtrl
})
.state('state2', {
url: "/events/:id",
templateUrl: "partials/events.html",
controller: eventsCtrl
});
function eventsCtrl($scope){
// shared controller
}
Again, this is probably bad practice but I can't think of a better solution
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…