ng-click

What is ng-click: ng-click used to perfom a task when element is clicked.

Description of ng-click: It is importan directive of angularjs.

Syntax of ng-click:<div ng-cick="myfun()"></div>
Or
<div ng-cick="msg='This is angularjs example of ng-click'"></div>

How to Use ng-click/ng-click Example:Example:
<div ng-init="msg='angularjs example'">
    msg1:{{msg}}
    <div ng-cick="msg='This is angularjs example of ng-click'">
        msg2:{{msg}}
    </div>
</div>
o/p: msg:angularjs example
  //when ng-click fire
     msg:This is angularjs example of ng-click

No comments :

Post a comment