Thursday, February 21, 2013

AngularJS ng-click button click notes

Video Link

The presenter in the video nails it when they say 'Extreme Separation' of concerns.  I love this separation, but when prototyping... it makes you think.  Times that by 10 when you have chained directives!

I do think that it's more Angular-esque to use ng-click.

This example shows ng-click with a directive. http://jsfiddle.net/V7Kpb/12/


Quick show hide box
<div class="btn btn-info" ng-model="showSummary"
       ng-click="showSummary = 2/showSummary" 
       ng-init="showSummary=0">
  Show Summary
</div>
<div class="well well-small" ng-show="showSummary">My Text Here</div>



1 comment:

  1. Excellent information with unique content and it is very useful to know about the information based on blogs.this is valuable information for learners.thanks
    Angularjs Training In Hyderabad

    ReplyDelete