0
방향 변경 작업 을 확인하려고하는데 각도가인데 작동하지 않습니다.각도 변경이 각도에서 작동하지 않습니다.
var myApp = angular.module('myApp',['ngTouch','matchmedia-ng']);
function checkOrientation($scope){
if($scope.landscape){
$scope.isLandscape="landscape";
alert($scope.isLandscape);
}
else{
$scope.isLandscape="portrait";
alert($scope.isLandscape);
}
}
myApp.controller('MainController', ['$scope', '$window','matchmedia',
function($scope, $window, matchmedia) {
$scope.submit = function() {
alert("submitted!");
}
$scope.desktop = matchmedia.isDesktop();
$scope.tablet =matchmedia.isTablet();
$scope.phone = matchmedia.isPhone();
$scope.landscape = matchmedia.isLandscape();
if($scope.desktop){
alert("desktop");
}
else if($scope.tablet){
alert("tablet");
}
else if($scope.phone){
$scope.isDevice = 'phone';
}
checkOrientation($scope);
/*screen.bind('orientationchange', function() {
$route.reload();
});*/
angular.element($window).bind('orientationchange', function ($scope) {
checkOrientation($scope);
});
}]);
$ route.reload() 옵션도 시도했지만 작동하지 않습니다. 그것은 작동하지만 내가 방향을 바꿀 때 작동하지 않습니다.