我修改了这里的代码:
http://jsfiddle.net/jaredwilli/SfJ8c/
var App = angular.module('App', []);
App.directive('resize', function ($window) {
return {
//restrict: 'A',
scope: {},
link: function(scope, element) {
var w = angular.element($window);
alert('Rezise');
w.bind('resize', function() {
scope.$apply();
});
}
};
});
当仅调整浏览器窗口的大小时,这不起作用...我缺少什么?