Rob Crocombe
Rob Crocombe

Reputation: 361

Angular $injector:modulerr for ui-router $urlServiceProvider

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

Upvotes: 0

Views: 577

Answers (1)

Pramod_Para
Pramod_Para

Reputation: 681

Here is the updated link to your plunkr code, error resolved

https://plnkr.co/edit/cPUAnIQzVFOpsa0xWkJk?p=preview

   <script data-require="ui-router@*" data-semver="1.0.0-beta.2" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/1.0.0-rc.1/angular-ui-router.min.js"></script>

Upvotes: 1

Related Questions