【发布时间】:2015-09-17 20:38:14
【问题描述】:
请参考-http://jsfiddle.net/U3pVM/18701/
在控制台中,我只看到“outer1”被记录,内部范围没有记录。有什么遗漏吗?
var app = angular.module("myapp", []);
app.controller("outer1", function($scope) {
$scope.$on("newmessage", function() {
console.log("outer1");
});
$scope.$broadcast("newmessage");
});
【问题讨论】:
标签: javascript angularjs broadcast