Scope in AngularJS is an object that binds the view (HTML) and the controller (JavaScript). It is an object that refers to the model and is an execution context for expressions. Scopes are arranged in hierarchical structure which mimic the DOM structure of the application.
Example:
Name:
{{name}}
var app = angular.module(‘myApp’, []);
app.controller(‘myCtrl’, function($scope) {
$scope.name = “John Doe”;
});
In the above example, the scope is the object that binds the view (HTML) and the controller (JavaScript). The scope is the $scope object that is passed to the controller function. The $scope object has the name property set to “John Doe” which is displayed in the view.