InterviewSolution
| 1. |
AngularJS Events |
|
Answer» AngularJS Events The ng-click DirectiveThis ng-click directive defines AngularJS code that will execute on element is being clicked. ![]() Example No 2 for ng-click![]() Toggling True and FalseIf we want to show a section of HTML code hide or show when we click on button. Same we do on dropdown MENU and make the button behave like toggle switch:- ![]() In above figure showtopic variable starts out as the boolean value as false. With myFunc function sets the showtopic variable to opposite of what it is by using the not operator. $event ObjectWe can also PASS $event object as an argument when we CALL the function.The $event object CONTAINS the browser event object. Below example will be more clear to you:-
|
|