0

I'm using Angualr 1.1.x - Inside all my controllers I am doing am using the key word this that I use to store all my data and access it in the html file.

var vm = this;

Then inside my HTML views I am delearing my controllers like this:

<div ng-controller="ControllerName as vm">

But I have been wondering why when I call

$scope or vm in the console it turns out to be undifined.

Can anyone explain this to me?

hirse
  • 2,394
  • 1
  • 22
  • 24
Ayo Adesina
  • 2,231
  • 3
  • 37
  • 71

0 Answers0