1

Context : I use ng-show (or ng-hide) to show a chart (hightchart-ng) only when my data is loaded.

The chart redraws when the data is loaded. So in theory, it redraws at the same time I show the chart. But the chart redraws when it is still not displayed (display: none), so it applies default size (not the real size available when shown).

Question : Let's say i have an expression A used in my template with ng-show :

    <div ng-show="A">
        <highchart config="myconfig"></highchart>
    </div>

I can't watch A to redraw manually my chart, cause it would be the same problem.

I don't want to know when A is true, but whenA is true AND ng-show ended to show the chart.

Any idea ?

Edit Solution : I found a solution. Creating a directives which look at the class of the element, like it is explained here : Running code after an AngularJS animation has completed

Community
  • 1
  • 1
antoinestv
  • 3,286
  • 2
  • 23
  • 39
  • use the A as a scope variable and assign it the value in controller. i.e $scope.A= false // when wanna hide and $scope.A = true // wanna show the chart – Sunny_Sid May 28 '15 at 09:50
  • I don't get your idea, it is already a variable in the scope. My problem is that i don't want to know when `A` is true, but when `A` is true **AND** `ng-show` ended to show the chart. – antoinestv May 28 '15 at 09:54

0 Answers0