Angular is one of the most current web development frameworks around the world. In almost every interview, you will have to struggle with fierce competition, in order to achieve high…
What are ng-include and ng-click directives in AngularJs?
ng-include helps to include different files on the main page. The ng-include directive includes HTML from an external file.
The included content will be included as child nodes of the specified element. The value of the ng-include attribute can also be an expression, returning a filename.
By default, the included file must be located on the same domain as the document.
ng-click can be used in scenarios like when you click on a button or when you want to do any operation. It tells AngularJS what to do when an HTML element is clicked.
<button ng-click="count = count + 1" ng-init="count=0">OK</button>
The above code will increase the count variable by one whenever the button is clicked.