我试图从窗口事件触发AngularJS控制器函数。但是,函数内部的$ http()不会执行。它就此停止。
window.addEventListener("message", function(msg) {
// this works!!
alert(angular.element(document.getElementById('ListFindRooms')).scope().var);
// this kinda works, but Angular $http() inside the funciton is not executed
angular.element(document.getElementById('ListFindRooms')).scope().function();
}
});