Answer the question
In order to leave comments, you need to log in
How to overcome glitches with block sizes in angularjs?
Hello.
The bottom line is that charts are used on the '/dashboard' location.
If you open the site with this location, then everything is in order. If you come to this location from a different path, then the graphs are displayed with standard sizes (400 by 600, sort of, but not the point).
It helps to call $(window).resize() 100 milliseconds after the controller is executed, but it's a crutch :)
The same glitch with google maps.
What is the right thing to do in such a situation?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
Make a directive that displays the graph. This is the best way.
As for the time, you miraculously picked up these 100ms) I assure you, on weaker machines it will no longer be 100. If you don’t want to write a directive, then at least inject the $timeout service and instead of setTimeout call:$timeout(function(){$(window).resize()})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question