NgAnimate does not work when working with requirejs

I have the following code in a file main.js:

require.config({

paths: {
    'angular': 'libs/angular/angular',
    'angular-route': 'libs/angular-route/angular-route',
    'angular-resource':'libs/angular-resource/angular-resource', 
    'angular-animate':'libs/angular-animate/angular-animate.min',       
    'domReady': 'libs/requirejs-domready/domReady',
    'jquery':'libs/jquery/jquery-1.11.0.min',
    'calendar':'libs/calendar/calendar',
    'blockUI':'libs/blockUI/jquery.blockUI',
    'modernizr':'libs/modernizr-2.6.2.min',
    'calendario':'libs/jquery.calendario',
    'respond':'libs/respond.min',        
    'pushy':'libs/pushy/pushy',
    'html5shiv':'libs/html5shiv',
    'custom':'libs/custom',
    'toastr':'libs/toastr/toastr.min',
    'picker':'libs/pickadate/lib/picker',
    'pickadate':'libs/pickadate/lib/picker.date',

},

/**
 * for libs that either do not support AMD out of the box, or
 * require some fine tuning to dependency mgt'
 */
shim: {
    'angular': {
        exports: 'angular'
    },
    'angular-route': {
        deps: ['angular']
    },
    'angular-resource':{
        deps:['angular']

    },
    'angular-animate':{
        deps:['angular']
    },
    'blockui': ["jquery"],
    'pushy':{
        deps:['jquery','modernizr'],           
    },
    'custom':{
        deps:['jquery']
    },
    'calendario':{
        deps:['jquery']
    },
    'picker':{
        deps:['jquery']
    },
    'pickerdate':{
        deps:['jquery']
    },
    'toastr':{
        deps:['jquery']
    }
},
catchError: {
    define: true
},
waitSeconds:1,

deps: [
    // kick start application... see bootstrap.js
    './bootstrap'
]
 });

in my bootstap.js file i have the following code

 require([
    'require',
    'angular',  
    'angular-animate',  
    'jquery',        
    'picker', 
    'pickadate',          
    'app',
    'routes'
 ], function (require,ng,ngAnimate,$,picker,pickadate) {
    'use strict';

    /*
     * place operations that need to initialize prior to app start here
     * using the `run` function on the top-level module
     */

    require(['domReady!'], function (document) {
        ng.bootstrap(document, ['app']);
    });
});

in the app.jsfile I have the following code:

 define([
    'angular',    
    'angular-route',
    './controllers/index',
    './directives/index',
    './filters/index',
    './services/index'
 ], function (angular) {
    'use strict';

    return angular.module('app', [
        'app.controllers',
        'app.directives',
        'app.filters',
        'app.services',       
        'ngRoute',        
        'ngResource',
        'ngAnimate'
    ]);
});

it produces the following error:

Unprepared error: [$ injector: unpr] Unknown provider: $$ asyncCallbackProvider <- $$ asyncCallback <- $ animate <- $ compile          http://errors.angularjs.org/1.2.3/ $ injector / unpr? p0 =% 24% 24asyncCallbackProvider% 20% 3C-% 20% 24% 24asyncCallback% 20% 3C-% 20% 24animate% 2 ......

+4
source share
1 answer

, AngularJS, 1.2.6 1.2.15.

Angular -animate - : $$ asyncCallbackProvider < - $$ asyncCallback < - $animate < - $compile

1.2.3 1.2.18

, , , ngAnimate AngularJS .

+3

Source: https://habr.com/ru/post/1537693/


All Articles