Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

$scope Object in AngularJS

Inject $scope to expose model properties and methods to the view.

$scope Object in AngularJS — a practical guide to AngularJS $scope with clear examples you can reuse in real projects.

AngularJS Tutorial Series (13/99). Prefer one article? Read the complete AngularJS tutorial.

Short description

Prefer controller-as (this / vm) in newer AngularJS style guides.

$scope example

angular.module('myApp')
  .controller('HelloCtrl', function ($scope) {
    $scope.name = 'Asha';
    $scope.greet = function () {
      return 'Hello ' + $scope.name;
    };
  });

Leave a reply

Your email address will not be published. Required fields are marked *