We have legacy code written in AngularJS that does not use controllerAs
.
Our BaseController
(Plunker: script.js line 19) has this code to make all class methods available in $scope
without writing this.$scope.method = ...
this.$scope[key] = this[key].bind(this)
Now since we are starting to migrate to Controller as vm
syntax we do not need this code any more. In Plunker NewCtrl
does not even need $scope
injected, but because of this line we need to.
Question: How to find out if current controller (NewCtrl
) is used with controllerAs
syntax or not?