Home » AngularJS ng-click Directive

AngularJS ng-click Directive

by Online Tutorials Library

AngularJS ng-click Directive

The AngularJS ng-click directive facilitates you to specify custom behavior when an element is clicked. So, it is responsible for the result what you get after clicking.

It is supported by all HTML elements.

Syntax:

Parameter explanation:

expression: It specifies an expression that is executed when an element is clicked.

Let’s take an example to demonstrate the ng-click directive.

See this example:

Example1:

Test it Now


ng-click directive example using function

Example2:

Test it Now

You may also like