我是angularjs中的新成员。我搜索了很多隐藏一些HTML元素的身体调整大小,但没有工作。这是我的控制器代码。如何隐藏屏幕上的某些元素在angularjs中调整大小
var app = angular.module('studentPage',[]);
app.controller ('studentController',function($scope, $window) {
var appWindow = angular.element($window);
appWindow.bind('resize', function() {
if($window.innerWidth < 600){
alert("hello");
$scope.ohh = true;
}
});
});
和在这些地方如果想要实现这个使用AngularJS我使用NG-显示
<div id="sidebar-wrapper" ng-show="ohh">
你必须手动触发使用$消化周期apply()。 – talentedandrew