A
A
a1en_yeah2016-08-18 16:46:23
Angular
a1en_yeah, 2016-08-18 16:46:23

How to track down the reasons for the strange behavior of the site on Angular JS?

Good afternoon,
I continue to refine the code that I got, and I observe the following.
If you repeatedly click on the pages, and return to the previous one (or let's say to the root of the site), the functions on them cease to be performed.
Let's say on the first page I have a list of servers, and when you click on a server, a list of the databases of each server opens. So if you switch between them, you can see that for about 5 repetitions there is a delay in displaying information, for 6 it still increases, and for the 7th attempt I still don’t get anything.
It looks like something is looping, but I can't find a way to track it down.
The transition occurs through a directive like goto='/server/{{cluster.host}}/id/{{cluster.id}}' >{{cluster.host}}
$apply() is bothering me here, but again, I can't track it down.
Do you have any ideas?

.directive('goto', function($location)  {
    return {
      restrict: 'A',
      link: function(scope, element, attrs) {
        element.on('click', function(){
          scope.$apply(function() {
                    $location.path(attrs.goto);
            });
        });
      } 
    };  
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
a1en_yeah, 2016-08-23
@a1en_yeah

Ultimately, that was the problem. that the previous developer set to run several functions at the same time, for all tabs of the page. Moreover, the output of information took place through all sorts of highcharts, etc., which apparently made everything heavier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question