Angular animated error loading

I develop this simple angular page. Bower I use to install the components that are necessary to me, and the application used to work fine. Until I decided to use animation library angular. For the first time I used Bauer, who asked me what "suitable" Angular library should be used: 1.2.6 (it is already installed and running) or 1.2.14.

So, if I chose 1.2.6 bug coming out just after the addition of

var mainApp = angular.module('myStopApp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'ngAnimate', 'myStopModule' ]) 

there is

Unprepared error: [$ injector: unpr] Unknown provider: $$ asyncCallbackProvider <- $$ asyncCallback <- $ animate <- $ compile

if I choose a different version, the problem will move to code where the use of the ng class does not seem to be recognized.

I have an element with ng- class = "testClass" and the element of the list, where I have a:

 ng-click="selectStop(stop); testClass='stop-active'" 

where I have to animations.css:

 .stop-active-add, .stop-active-remove { -webkit-transition:all linear 0.5s; -moz-transition:all linear 0.5s; -o-transition:all linear 0.5s; transition:all linear 0.5s; display:block!important; } .stop-active-add.add-active, .stop-active-remove { opacity:0; } .stop-active-add, .stop-active-remove.-remove-active { opacity:1; } active-remove { .stop-active-add, .stop-active-remove { -webkit-transition:all linear 0.5s; -moz-transition:all linear 0.5s; -o-transition:all linear 0.5s; transition:all linear 0.5s; display:block!important; } .stop-active-add.add-active, .stop-active-remove { opacity:0; } .stop-active-add, .stop-active-remove.-remove-active { opacity:1; } active { .stop-active-add, .stop-active-remove { -webkit-transition:all linear 0.5s; -moz-transition:all linear 0.5s; -o-transition:all linear 0.5s; transition:all linear 0.5s; display:block!important; } .stop-active-add.add-active, .stop-active-remove { opacity:0; } .stop-active-add, .stop-active-remove.-remove-active { opacity:1; } 

During page load I have an error:

 [$parse:syntax] Syntax Error: Token '=' implies assignment but [selectStop(stop); testClass] can not be assigned to... 

It seems that the first function, and use css-angular hook can not be together in the same ng-click.

Can I solve at least one of two problems :)?

+6
source share
1 answer

Angular seems to have changed is that they allow you to do in terms of clicks for your processor. Why not just put the assignment operator in a function, you have to call the handler for clicks?

 ng-click="selectStop(stop)" 

And then selectStop () function:

 $scope.selectStop = function(arg) { testClass = 'stop-active'; ... } 
0
source

All Articles