於 controller 外取得 scope 物件
<div ng-app="module1" ng-controller="ctrl" id="divctrl">
var scope = angular.element(document.getElementById('divctrl')).scope();
scope.$apply(function () {
scope.speakers = ['11','22'];
});
var scope = angular.element(document.getElementById('divctrl')).scope();
scope.$apply(function () {
scope.speakers = ['11','22'];
});
留言