Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ngAnimate provider error when trying to inject this into my controller #11965

Closed
landed1 opened this issue May 28, 2015 · 2 comments
Closed

ngAnimate provider error when trying to inject this into my controller #11965

landed1 opened this issue May 28, 2015 · 2 comments

Comments

@landed1
Copy link

landed1 commented May 28, 2015

1.3.15 (and below tried)
I have ---
app.js

var baApp = angular.module('baApp', [
  'ngResource',
  'ngSanitize',
  'ngAnimate',
  'ngRoute',
  'ngTouch',
  'LocalStorageModule',
  'videoController',
  'toursController'
])
  .config(

then in a controller js file Main.js ---

angular.module('baApp')
    .controller('MainCtrl', ['$scope','$location','localStorageService','ngAnimate',function ($scope,$location,localStorageService,ngAnimate){...

I am getting the error - Unknown provider: ngAnimateProvider

Usually this is due to a different version of the animate and angular .js files (yes I checked both are loading and the correct version - I really do not know what else to try...)

thanks

@tjokimie
Copy link

@landed1 This is not a bug.

ngAnimate is the module name not the service you are trying to inject. If you want to use animate service you should inject $animate instead of ngAnimate. See https://code.angularjs.org/1.3.15/docs/api/ng/service/$animate

@landed1
Copy link
Author

landed1 commented May 28, 2015

Thank you so much - I don't know of a better place to post now that stack doesn't allow any more questions. It works and no not a bug but an issue becuase of my misuse.

@Narretz Narretz closed this as completed May 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants