angularjs - Angular slow hide/show -


To hide and show some code I have the following:

   & Lt; An id = "back button" type = "button" ng-show = "onslide" class = "left carousel-control" ng-click = "onslide = onslide - 1" & gt; & Lt; Span class = "glyphicon glyphicon-chevron-left" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; An id = "nextButton" type = "button" ng-hide = "onSlide == slide.length - 1" class = "right carousel control" ng-click = "onslide = onslide + 1" & gt; & Lt; Span class = "glyphicon glyphicon-chevron-right" & gt; & Lt; / Span & gt; & Lt; / A & gt;  

The display is very good when using the button, the slides are switched right However, if I change scope.onSlide to the controller, then slide switching There is a lot of delay, though a console.log suggests that the scope.onSlide is actually incremental, can it leak?

Relevant control code:

  scope. $ ("VideoTime Converted", Function (Event, Time) {if (scope.videoState = "Game") {if (time> scope.scenario.presentation [0] .syncManifest [scope.onSlide]) scope OnSlide ++;}});  

As you can see, I am listening to the event of a time, which would set fire to every 250 ms, and compare the time when the slide is going to change . If current time is high, then I increase slide. When I look at its various parts in the console.Log, it works perfectly behind all the scenarios.

This is probably because ng-repeat creates a new radius, and ng-show In you give a primitive value instead of the object.

Try creating and assigning an object like $ scope.carousel.onSlide to your controller

Classic:

/ html>

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -