Thursday, December 5, 2013

AngularJS directives:




ng-if

From an aesthetic point ng-if works similar to ng-show and ng-hide, but instead of hiding the Dom element it selectively adds or removes it from
the DOM tree based on whether the expression supplied it true for false. This is use full because unlike hide and show, the removed element
will not be collected when using css selectors.


ng-class-even/ng-class-odd
While in ng-repeat, we can selectively add classes to the repeated element based on whether the index of the element is odd or even.
Bonus:$index gives the index of the element in the iterator.


ng-change
ng-change lets you to trigger a function or evaluate a expression when the text changes in the particular text box. For the ng-change to work,
the text box should be binded to a model.


ng-dbclick
db-click handles double click events within an element and lets you invoke a function or evaluate a expression when it is done.
similar:ng-mousedown,ng-keypress.


ng-style
Lets you add inline styles to your elements. although inline styles are evil and should be avoided, this cool as you can dynamically update
your style attribute values based on a model binding.


ng-pluralize
The pluralize directive lets you pluralize your content based on en-US localization rules.


ng-cloak

When the browser renders HTML if AngularJS is not loaded completly, the bindings will show up as very ugly curly braces.
This directive acts as blanket from displaying angular binding syntax before Angular JS is loaded into the browser.
Using this directive in your main pages is a must.


similar:ng-href

These along with many other built in angular directives give us a hint of what angular project philosophy is and where it is heading towards.
Making Common UI events more declarative, reusable and decoupled from the application logic.


The above content is copied, ntg wrong right our life is also copied from others like lifestyle way of dressing appearance ..what else even our daily work in our office is completely copied from our god ..didn't get it www.google.com yaar...


Thanks for ur time

No comments:

Post a Comment