| AngularJS-QA-12 :👈 | 👉:AngularJS-QA-14 |
AngularJS Question Answers - 13 |
| Question: | What is the purpose of the directive 'ng-init'? |
| Answer: | ng-init: Defines initial values for an application. |
| Question: | How to check a reference is defined in AngularJS? |
| Answer: | Use angular.isDefined() which returns true if the reference is defined
Output:false true |
| Question: | How do you check a reference is DOM element or not in AngularJS? |
| Answer: | Use angular.isElement() which returns true if the reference is a DOM element
Output:
false |
| Question: | How to check a reference is a number in AngularJS? |
| Answer: | Use angular.isNumber() which returns true if the reference is a number.
Output:true False |
| Question: | What is the purpose of the directive 'ng-jq'? |
| Answer: | ng-jq: Specifies that the application must use a library, like jQuery. |
| Question: | What is the purpose of the directive 'ng-keydown'? |
| Answer: | ng-keydown: Specifies a behavior on keydown events. |
| Question: | What is the purpose of the directive 'ng-model'? |
| Answer: | ng-model: Binds the value of HTML controls to application data. |
| Question: | How do you check a reference is String or not in AngularJS? |
| Answer: | Use angular.isString() which returns true if the reference is a string.
Output:false true |
| Question: | How do you check a reference is Undefined in AngularJS? |
| Answer: | Use angular.isUndefined() which returns true if the reference is Undefined
Output:false true |
| Question: | What is the purpose of the directive 'ng-keypress'? |
| Answer: | ng-keypress: Specifies a behavior on keypress events. |
| AngularJS-QA-12 :👈 | 👉:AngularJS-QA-14 |