Ahsan Ahsan - 3 months ago 19
AngularJS Question

Issue with adding ngMaterial as a module

I am seeing this error:

Error: $injector:unpr
Unknown Provider
Unknown provider: $$asyncCallbackProvider <- $$asyncCallback <- $animate <- $compile


All I am doing is this (I have additional code for other modules, just adding the relevant ones here):



<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.0.7/angular-material.min.js"></script>


and

angular
.module('app', [
//Angular modules
'ngRoute',
'ngMaterial',

//third-party modules
'firebase',
])
.config(configFunction)
.run(runFunction);


Any idea what is going on ?

Thanks.

Answer

You need to make sure the versions are same,

 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-animate.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-aria.min.js"></script>

here is the working Plunker