【发布时间】:2016-09-30 10:04:14
【问题描述】:
我有以下几点:
$rootScope.$on('setmoney',function (thisdata) {
console.log("setting money");
console.log("money is : " + thisdata);
});
还有这个:
$rootScope.$broadcast('setmoney', {cash: 100000});
如何确保可以在 setmoney rootscope.on 函数中检索参数 cash?
此数据后的输出:
Object {name: "setmoney", targetScope: Scope, defaultPrevented: false, currentScope: Scope}
currentScope
:
null
defaultPrevented
:
false
name
:
"setmoney"
preventDefault
:
()
targetScope
:
Scope
__proto__
:
Object
【问题讨论】:
标签: angularjs broadcast rootscope