What is an expression in Angular?
Expressions are used to bind data to the view (double curly brackets)
What is the difference between “==” and “===” ?
-double equals compares two types
-triple equals compares types and values
ex, “2” == 2; //true
“2” === 2; //false
What are the differences between null and undefined?
null is an object with no value
undefined is a type
What are some of the core directives in Angular?
ng-app
ng-model
ng-bind
How would you improve page runtime performance as your application scales?
How do you share data between controllers?
What is a digest cycle in Angular?
a digest cycle compares old and new scoped model values
When does a digest cycle happen?
it happens whenever a new event is set off
What is the difference between one-way binding and two-way binding?
How does $scope.$apply() work?
it looks at all the declared models and forces or applies the change to any model that have been altered. but its a bad practice it forces angular to run on all entire models and variable but sometimes necessary when dealing with third party plugins and when you’re dealing with timing issues.
Explain data binding in Angular.
Data synchronization between the model and view components. The view is a projection of the model at all times. When the model changes, the view reflects the change, and vice versa.”
What are directives?
They are essentially functions that execute when the Angular compiler finds them in the DOM. Some of the most commonly used directives are ng-app,ng-controller and ng-repeat.
What are controllers in Angular?
Controllers are Javascript functions which provide data and logic to the view. As the name suggests, they control how data flows from the server to view.
What is the difference between link and compile in Angular?
Explain what is Injector in Angular.
An injector is a service locator, used to retrieve object instance as defined by provider, instantiate types, invoke methods, and load modules.
What is scope in Angular?
Scopes are objects that refer to the model. They act as glue between controller and view.
What are services in Angular?
Services are singleton objects which are instantiated once within an application. ex, $http service
Explain ng-bind directive.
Typically you don’t use ng-bind and use the double curly braces but in instances where the template/view is flashes in its raw html state then ng-bind or ng-cloak can solve that issue.
Explain what is string interpolation in Angular.js ?
The compiler matches text and attributes using interpolate service to see if they contains embedded expressions. As part of normal digest cycle these expressions are updated and registered as watches.