I'm trying to use ui-router with Angular 1.5. I want to add a customer parameter type like in https://stackoverflow.com/a/27422981. I have read that $urlMatcherFactory.type()
has been deprecated in favour of $urlService.config.type()
.
var app = angular.module('plunker', ['ui.router'])
.config(['$urlServiceProvider', function($urlService) {
}]);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
You can see above, and in this Plunker https://plnkr.co/edit/Rk6WRAEUfpUFwyZhnAH0 that $urlServiceProvider
cannot be injected, even though it can be found in the documentation here https://ui-router.github.io/ng1/docs/latest/modules/injectables.html#_urlserviceprovider
I have tried using the older $urlMatcherFactory.type()
but, while the injection process works, it doesn't register any new type I give it (like the boolean from the linked Stack Overflow answer).
Can anyone help me create a new parameter type with angular-ui-router? Thanks