我用这个。
<!DOCTYPE html>
<html lang='en' ng-app="main" ng-controller="Main">
<head>
<meta charset="UTF-8"/>
<meta ng-if="isAndroidWelcome()" name="viewport" content="width=900">
但元标记始终处于活动状态,无关紧要isAndroidWelcome()
返回true。
这是主控制器的代码
var main = angular.module("main", ['ngDialog', 'angularFileUpload', 'ngCookies',
'angularUtils.directives.dirPagination', 'infinite-scroll',
'ngTagsInput', 'tiksem-keyboard', 'ngSanitize' /*HTML_TEMPLATES_PLACEHOLDER*/]);
main.controller("Main", function($http, $element, $timeout, $scope, $locale, $location, $cookies){
ControllerUtils.initController($scope, $location);
var setLang = $scope.setLang = function(lang) {
$scope.lang = lang;
$scope.tr = TRANSLATION[lang] || TRANSLATION["en"];
};
//setLang($locale.id.split("-")[0]);
setLang("ru");
var onSignedInChanged = [];
var isMobile = $scope.isMobile = Utilities.mobilecheck();
var isAndroid = $scope.isAndroid = Utilities.isAndroid();
$scope.isAndroidWelcome = function() {
return $scope.getPath() == "welcome" && isAndroid;
};
答案 0 :(得分:0)
这里有更多这样的事情:
<meta ng-change="isAndroidWelcome()" ng-model="viewport" content="width=900">
通过这种方式,您可以在您创建的ng-model(视口)上使用Angular控制器来执行isAndroidWelcome()函数。