1
林具有如下:
$rootScope.$on('setmoney',function (thisdata) {
console.log("setting money");
console.log("money is : " + thisdata);
});
而这别的地方:
$rootScope.$broadcast('setmoney', {cash: 100000});
我怎样才能确保我可以取回参数现金setmoney rootcope.on函数? thisdata后
输出:
Object {name: "setmoney", targetScope: Scope, defaultPrevented: false, currentScope: Scope}
currentScope
:
null
defaultPrevented
:
false
name
:
"setmoney"
preventDefault
:
()
targetScope
:
Scope
__proto__
:
Object
救了我从头痛..谢谢很多家伙 –