You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

I read somewhere that with ng-show comes performance issues when rendering a page so to combat that I realized I could use $element dependency to improve performance.
This actually frees you from using NG-IF and NG-SHOW
In the controller

In the  view

[pastacode lang=”javascript” message=”” highlight=”” provider=”manual” manual=”%3Cdiv%20class%3D%22wrapper%22%3E%0A”/]

This is a remote computer

[pastacode lang=”javascript” message=”” highlight=”” provider=”manual” manual=”%3C%2Fdiv%3E%0A%3Cp%3E%0A%0A%0A%0A%0Aapp.controller(‘myController’%2Cfunction(%24scope%2C%24element)%7B%0Avar%20magDiv%20%3D%20%24element.find(%22.wrapper%22)%3B%0AmagDiv.hide()%3B%0A%24scope.someEventHereLikeNg-click%3D%20function%20()%20%7B%0AmagDiv.show()%3B%0A%7D%3B%0A%7D)%3B”/]

Easy, Cheesy and Peasy.

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF