- A There is no difference between ng-if and ng-show
- B ng-if removes the element from the DOM, while ng-show hides the element using CSS
- C ng-show removes the element from the DOM, while ng-if hides the element using CSS
- D ng-if and ng-show are used for different purposes and cannot be compared
- Share this MCQ
Answer:
B
Share this MCQ
Answer: B) ng-if removes the element from the DOM, while ng-show hides the element using CSS
Explanation: The ng-if directive removes the element from the DOM when its condition is false, while the ng-show directive hides the element using CSS when its condition is false.
Click me to Read more Question & Answer of AngularJS MCQShare this MCQ