AngularJS Interview Questions

29. Explain one-way binding and two-way binding?
One way binding => the scope variable in the html will be set to the first value its model is bound to.
Two way binding => the scope variable will change it’s value everytime its model is assigned to a different value.

30. Explain when should you use an attribute versus an element?
Element => When creating a component that is in control of the template.
Attribute => When decorating an existing element with new functionality.

Comments are closed here.