AngularJS Interview Questions
1 .
About ng-include directive.
We can embed HTML pages within a HTML page using ng-include directive.

<div ng-app = "" ng-controller = "MyController">
   <div ng-include = "'sample.html'"></div>
   <div ng-include = "'smple_2.html'"></div>
2 .
What is the difference between one-way binding and two-way binding ?
One way binding implies that the scope variable in the html will be set to the first value its model is bound to (i.e. assigned to)
Two way binding implies that the scope variable will change it’s value everytime its model is assigned to a different value.
3 .
How do you disable a button depending on a checkbox’s state ?
The developer can use the ng-disabled directive and bind its condition to the checkbox’s state.

<body ng-app>
  <label><input type="checkbox" ng-model="checked"/>Disable Button</label>
  <button ng-disabled="checked">Select Me</button>
4 .
What Is $Scope In AngularJS ?
It is an application object. And behaves as the owner of the apps variables and functions. Scope object has access to both View and controller. Thus it works as a medium of communication between both of them. This object contains both data and functions. We can use it to access model data of the controller.

Following are the key characteristics of the scope object.

It provides observers to watch for all the model changes.
Provides the ability to propagate model changes through the application as well as outside the system to other associated components.
Scopes can be nested in such a way that they can isolate functionality and model properties.
Provides an execution environment in which expressions are evaluated.
5 .
What Is “$RootScope” In AngularJS ?
Every AngularJS application has a “$rootScope” that is the topmost scope created on the DOM element. An app can have only one $rootScope which will be shared among all its components. It contains the ng-app directive. Every other scope is its child scope. It can watch expressions and propagate events. Using root scope we can set the value in one controller and read it from the other controller.

6 .
What are AngularJS Services ?
In AngularJS you can make your own service, or use one of the many built-in services. AngularJS services are JavaScript functions for specific tasks, which can be reused throughout the application.

AngularJS has about 30 built-in services.

$location service
$http Service
$timeout Service
$interval Service
and more..
7 .
Why we need Angular JS/ React / Any front end JS frameworks ?
Because it is loosely couped with the backend, so any type of backend rest services can be called out from the angular services, where as the spring MVCs tightly coupled compare to angular js where view also should be in JSP/JSF/ any Java supported technologies.
As this is a great single page application framework, it provides awesome next generation user experience.
As angular js is a widely used for mobile end application developments, it beats other frameworks and stay front for many reasons including this.