What is ng-app, ng-init, and ng-model?



What is ng-app, ng-init, and ng-model?..

Answer / Vimal Kumar Chandra

ng-app is a directive that tells AngularJS where to start looking for the application. It should be added to the HTML body or any parent element within the application. ng-init is a non-standard AngularJS directive used for initializing controller properties with some data. It's discouraged because it can lead to hard-to-debug issues, and AngularJS provides better ways for data initialization, such as using controllers. ng-model, on the other hand, is used for creating a link between the view (the HTML input) and the model (a JavaScript property).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

Describe mvc in reference to angular.

1 Answers  


How does angular use singleton pattern?

1 Answers  


What is lazy loading and how to enable lazy loading in angular 2?

1 Answers  


What are promises in angular 2?

1 Answers  


What is singleton pattern? How does angular use it?

1 Answers  


How do you use singleton pattern?

1 Answers  


Does webpack remove unused imports?

1 Answers  


Why should I learn angular?

1 Answers  


What are the advantages of using angular 2?

1 Answers  


What is the difference between Rootscope and Scope in AngularJS?

1 Answers  


Difference between service, directive, and module?

1 Answers  


Can we use the open-source closure library with angular?

1 Answers  


Categories