• Core Java
  • SQL Tutorial
  • JavaScript
  • Struts
  • Java IO
  • RubyonRails
  • Servlet
  • JSP

  • <

    AngularJS Scopes

    The scope is the binding part between the HTML (view) and the JavaScript (controller).

    The scope is an object with the available properties and methods.

    The scope is available for both the view and the controller.

    Use of Scope

     <!DOCTYPE html>  
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>  
    <div ng-app="myApp" ng-controller="myCtrl">  
    var app = angular.module('myApp', []);  
    app.controller('myCtrl', function($scope) {  
        $scope.carname = "Volvo";  
    <p>The property "carname" was made in the controller, and can be referred to in the view by using the {{ }} brackets.</p>  

    © copyright 2017-2021 Completedone pvt ltd.