Title: How call $digest in this?
Tags: angularjs
Question: Now I write code without context, $scope  

```app.controller(function(){
  // ..
  this.list = [];
  // what ever work with a list of

  this.$digest(); // is not a function, why?


});
```

before I could

```app.controller(function($scope){
  // ..
  $scope.list = [];
  // what ever work with a list of

  $scope.$digest();


});
```

But me need this, how it work?

Comment: @Claies is that a canonical answer? Do you consider this question a duplicate?

Comment: just because you use `this` doesn't mean you can't inject `$scope`.

Comment: here is an answer I wrote a while back to try to explain the concept: http://stackoverflow.com/a/30644370/2495283

Comment: **storing values *directly*** on `$scope` is considered bad practice by **some**, however using `$scope` for what it is intended for is never a problem.

Comment: I would say yes, the answer should be a match to this question.

Comment: it isn't.  `$digest` is a function of `$scope`, and therefore, if you need to call `$digest`, you need to inject `$scope`.  `this` points to the controller;  using `this` (ControllerAs) instead of `$scope` creates an alias of the controller on `$scope`, but doesn't expressly give the controller access to `$scope` methods.  `$scope` is a provider that does a lot, and when people say "dont' use `$scope`", they probably should be saying "don't use `$scope` when it isn't necessary".  It is *necessary* if you need `$digest`.

Comment: as a side point, there are very few reasons to ever need `$digest`, and if you are so against `$scope` that you are arguing against it here, it's surprising that you aren't trying to find a way not to use `$digest`.

Comment: here is another more in depth analysis of the same topic, maybe this can explain it better (differently, at least). http://stackoverflow.com/a/14168699/2495283

Comment: $scope considered bad practise

Comment: how use $digest in this?



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 10, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:11/09/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<angularjs>', 'Title': 'How call $digest in this?', 'ViewCount': 14, 'id': 40513147, 'user_AboutMe': '', 'user_AccountId': 6334368.0, 'user_DisplayName': 'splincode', 'user_Reputation': 183.0, 'user_Views': 19.0, 'user_id': 4918275.0}}