Unknown Provider: $ionicModalProvider


#1

I’m getting this error when trying to use $ionicModal within a controller. My code is as follows:

.controller('TicketCtrl', function($scope, $routeParams, $http, $ionicModal) { etc...

My module looks like this:

angular.module('snappy.controllers', ['ionic'])

Any ideas on how to fix this?


#2

Hey @taylorotwell, are you using a new version of Ionic? Also, did you make sure to include the ionic module in your angular app:

angular.module('myApp', ['ionic'])

#3

Upgrading Ionic led to even more issues:

http://d.pr/i/dWbw


#4

Are you including this?

<script src="js/angular-ui/angular-ui-router.js"></script>

#5

That fixed a few things, but now my “nav” bar doesn’t work. This is how I use the nav:

<nav-page title="ticket.default_subject">

Was working before. Any ideas on that?


#6

@taylorotwell Not knowing exactly how your app is configured, we might struggle to help solve it. Take a look at this example plunker. It shows a typical app with side menu that includes the “states” for routing using the new ui-router.

Here’s another example using router and modal:


#7

I got this error with version 0.9.19. The service Modal was being registered under the name "Modal’ and not $ionicModal. This is fixed in 0.9.20.