JavaScript | Angular | Controller As Syntax: Cannot Use `this`
Cannot Use ControllerAs this Can anyone explain the following scenario to me, please? Works ng-controller="Parent as thus" Breaks ng-controller="Parent as this" That single letter which makes it a keyword -- which I want -- wrecks the forest. Why is this? P.S. I'm aware of the vm convention, but I find it disturbs portability of controllers/viewmodels. The problem is certainly not that this is a reserved word in JavaScript. There is no rule in the controller as syntax that says you would need to assign the value of this to a variable with the same name as the controller and I'm pertty sure