Using $scope
it\'s easy to emit an event or watch for one.
(function() {
\"use strict\";
angular
.module(\"app\")
.cont
In order to use anything that exists on $scope
, you are forced to inject $scope
. It's unfortunately that straightforward, which is a shortcoming of the "as" syntax.
The good news however is that injecting $scope
alongside this
does not change how the controller as syntax functions, it simply gives you access to all of the event management that lives on $scope
.
It's worth noting that this is one of the primary reasons for what is coming in Angular 2.0...there is a real problem and discrepancy between $scope
and the "Controller as" syntax that was bolted on to solve scoping issues in views.