Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: [$injector:modulerr] ngAnimate AngularJS 1.2

Tags:

angularjs

I'm getting Uncaught Error: [$injector:modulerr] by the time that I run my application, as far I know with this update to 1.2 there are several functionalities that are no longer part of the core, I've downloaded the angular-animage.js and the all the rest of external dependencies, for all the files the version is the same AngularJS v1.2.0-rc.2

I also have added the dependency to my app.js as follows:

'use strict';
angular.module('mseApp', ['ui.bootstrap', 'ui.select2', 'facebook', 'ngCookies', 'ngAnimate', 'ngRoute']).config(//mode configurations here);

My js references:

  <script src='@Url.Content("~/Scripts/angular.min.js")'> </script>
    <script src='@Url.Content("~/Scripts/angular-resource.min.js")'> </script>
    <script src='@Url.Content("~/Scripts/angular-route.min.js")'></script>
    <script src='@Url.Content("~/Scripts/angular-animate.min.js")'></script>
    <script src='@Url.Content("~/Scripts/ui-bootstrap-0.6.0.min.js")'></script>
    <script src='@Url.Content("~/Scripts/select2.js")' type="text/javascript"></script>
    <script src='@Url.Content("~/Scripts/angular-animate.min.js")'></script>
    <script src='@Url.Content("~/Scripts/angular-facebook.js")'></script>
    <script src='@Url.Content("~/Scripts/angular-cookies.min.js")'></script>

if I remove ngAnimate dependency it works just fine...

EDIT This is the plunker.

If I add the ng-route to the references it broke the app.

like image 693
pedrommuller Avatar asked Jun 10 '26 13:06

pedrommuller


1 Answers

With regards to the Plnkr, the issue is the following:

in angularjs-1.2.0-rc.2-animate-app.js, you have defined your module as follows:

var myApp = angular.module('mseApp', ['ngRoute', 'ngAnimate']);

While in your HTML, you have referred to the ng-app as follows:

<html ng-app="MyApp">

For AngularJS to pick up the module you have defined, you need the ng-app to refer to the module name you have specified in your JS. So it should in fact read:

<html ng-app="mseApp">

Making this change gets your app to work

like image 188
Shyam Seshadri Avatar answered Jun 13 '26 12:06

Shyam Seshadri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!