I'm using AngularJS's UI-router to do routing. Currently, I have this:
$stateProvider.state('mystate',
{
url: '/mystate/{id:int}/:slug/',
params: {
slug: {value: null, squash: true}
},
templateUrl: 'partials/mystate.html',
controller: 'MyStateCtrl'
}
);
The id and optional slug URL parameters are captured iff there is a trailing backslash. If there is no trailing backslash, this pattern is not even matched. I need it to match with or without the trailing backslash in all cases. How can I do that?
I was told here to attach the following config on my app:
.config(['$urlMatcherFactoryProvider', function($urlMatcherFactoryProvider) {
$urlMatcherFactoryProvider.strictMode(false);
}
]
)
I did. But it still doesn't work without the trailing slashes. What should I do?