In Angular, the scope is the binding part between the HTML, i.e. the view and the Javascript, urf, controller. It acts like an object having various available properties and methods. The scope is available for both modes, view and controller. Here’s an example of how to use the scope in Angularjs properly:

BY Best Interview Question ON 19 Jun 2020

Example

<div ng-app="myApp" ng-controller="myCtrl">

<h1>{{carname}}</h1>

</div>

<script>
var app = angular.module('myApp', []);

app.controller('myCtrl', function($scope) {
  $scope.carname = "Volvo";
});
</script>