【发布时间】:2015-11-10 11:06:12
【问题描述】:
我遇到了问题。 我尝试在 jQuery 事件处理程序中附加 $scope 对象的一些属性。这是我的代码:
.controller('dashboard', ['$scope', function($scope){
$( window ).resize(function(){
$scope.device = ($(document).width() > 768) ? 'desktop' : 'mobile';
});
}]);
但似乎设备变量没有附加在仪表板控制器的 $scope 上。 我的代码有什么问题? 谢谢:D
【问题讨论】:
标签: jquery angularjs events angularjs-scope handler