marcoslin / angularAMD

Facilitate use of RequireJS in AngularJS
http://marcoslin.github.io/angularAMD
MIT License
734 stars 171 forks source link

Error: undefined is not an object (evaluating '$animate.enter(clone, null, currentElement || $element).then') #109

Closed ambasador closed 10 years ago

ambasador commented 10 years ago

Hi

I just added ngAnimate like

var app = angular.module("ngreq-app", ['ngRoute', 'ngAnimate']);

and its throwing an error

Error: undefined is not an object (evaluating '$animate.enter(clone, null, currentElement ||
$element).then')

so when i remove ngAnimate everything is ok, i try as well ngload!ngAnimate, but error is the same

here is full list

http://localhost:9768/www/js/lib/angular/angular-route.js:923:70
publicLinkFn@http://localhost:9768/www/js/lib/angular/angular.js:6869:43
boundTranscludeFn@http://localhost:9768/www/js/lib/angular/angular.js:7009:28
controllersBoundTransclude@http://localhost:9768/www/js/lib/angular/angular.js:7650:35
update@http://localhost:9768/www/js/lib/angular/angular-route.js:922:36
$broadcast@http://localhost:9768/www/js/lib/angular/angular.js:14438:33
http://localhost:9768/www/js/lib/angular/angular-route.js:604:36
processQueue@http://localhost:9768/www/js/lib/angular/angular.js:12914:29
http://localhost:9768/www/js/lib/angular/angular.js:12930:39
$eval@http://localhost:9768/www/js/lib/angular/angular.js:14123:28
$digest@http://localhost:9768/www/js/lib/angular/angular.js:13939:36
$apply@http://localhost:9768/www/js/lib/angular/angular.js:14227:31
http://localhost:9768/www/js/lib/requirejs/angularAMD.js:153:38
execCb@http://localhost:9768/www/js/lib/requirejs/require.js:1658:38
check@http://localhost:9768/www/js/lib/requirejs/require.js:874:57
http://localhost:9768/www/js/lib/requirejs/require.js:1121:39
http://localhost:9768/www/js/lib/requirejs/require.js:132:28
http://localhost:9768/www/js/lib/requirejs/require.js:1164:23
each@http://localhost:9768/www/js/lib/requirejs/require.js:57:35
emit@http://localhost:9768/www/js/lib/requirejs/require.js:1163:21
check@http://localhost:9768/www/js/lib/requirejs/require.js:925:34
http://localhost:9768/www/js/lib/requirejs/require.js:1121:39
http://localhost:9768/www/js/lib/requirejs/require.js:132:28
http://localhost:9768/www/js/lib/requirejs/require.js:1164:23
each@http://localhost:9768/www/js/lib/requirejs/require.js:57:35
emit@http://localhost:9768/www/js/lib/requirejs/require.js:1163:21
check@http://localhost:9768/www/js/lib/requirejs/require.js:925:34
enable@http://localhost:9768/www/js/lib/requirejs/require.js:1151:27
init@http://localhost:9768/www/js/lib/requirejs/require.js:782:32
callGetModule@http://localhost:9768/www/js/lib/requirejs/require.js:1178:67
completeLoad@http://localhost:9768/www/js/lib/requirejs/require.js:1552:34
onScriptLoad@http://localhost:9768/www/js/lib/requirejs/require.js:1679:41
marcoslin commented 10 years ago

Looks like angular-animate.js is not loading. Can you share a little more info about your project structure, more specifically, your main.js?

ambasador commented 10 years ago

zrzut ekranu 2014-10-30 o 22 14 59 ok no prob

here is main.js file

require.config({

baseUrl: "js/scripts",

// alias libraries paths
paths: {
    'jquery': '../lib/jquery/dist/jquery.min',
    'jquery-velocity': '../lib/velocity/jquery.velocity.min',
    'velocity': '../lib/velocity/velocity.min',
    'velocity-ui': '../lib/velocity/velocity.ui.min',
    'angular': '../lib/angular/angular',
    'angular-route': '../lib/angular/angular-route',
    'async': '../lib/requirejs/async',
    'angularAMD': '../lib/requirejs/angularAMD',
    'ngload': '../lib/requirejs/ngload',
    'angular-animate': '../lib/angular/angular-animate.min',
    'angular-velocity': '../lib/angular/angular-velocity.min',
    'ui-bootstrap': '../lib/angular-ui-bootstrap/ui-bootstrap-tpls',

    // Main controllers
    'HomeController': 'controller/home_ctrl',
    'ContactController': 'controller/contact_ctrl',
    'AboutController': 'controller/about_ctrl',
    'PortfolioController': 'controller/portfolio_ctrl',
    'ItemController': 'controller/item_ctrl'
},

// Add angular modules that does not support AMD out of the box, put it in a shim
shim: {
    'velocity': {
        deps: ['jquery', 'jquery-velocity']
    },
    'velocity-ui': {
        deps: ['velocity']
    },
    'angularAMD': ['angular'],
    'angular-route': ['angular'],
    'angular-animate': ['angular'],
    'angular-velocity': {
        deps: ['velocity-ui', 'angular-animate']
    }
},

// kick start application
deps: ['app']
});
marcoslin commented 10 years ago

This looks right. I double checked the angularAMD tests and it does include test with ngAnimate. Can see if you can isolate this problem within a smaller project?

You can use the following gist as a starting point: https://gist.github.com/marcoslin/df4b741e92b2829eeae8

You can run the gist using: http://bl.ocks.org/marcoslin/df4b741e92b2829eeae8

skyfloyd commented 10 years ago

I had same problem. I resolve it by updating angular.js and angular-animate.js files. https://code.angularjs.org/1.2.26/

marcoslin commented 10 years ago

@ambasador I will close this issue as per comment from @skyfloyd. Do reopen if it does not solve your problem.