伊谢尔伦2017-05-15 17:13:07
作用就是告訴他的父級$scope,有事件觸發啦,事件的名字叫做boyslist,然後資料是result.data
如果你的父$scope上有監聽這個事件的話,就會觸發裡面的回呼函數,例如
$scope.$on('boyslist', console.log);
這樣就會印出來
具體可以看這個,然後看Scope Events Propagation
Scopes can propagate events in similar fashion to DOM events. The event can be broadcasted to the scope children or emitted to scope parents.
Scope Events Propagation那一小塊