Angular ng-show元素在iOS上消失

时间:2015-09-03 12:43:34

标签: javascript ios angularjs cordova

我的Angular / Cordova App中有一些非常简单的ng-show标签。在我的桌面环境中,一切正常,但在iOS上,我注意到元素有时会消失。

这通常会发生一次(在首次看到之后无法再现)并且重新定向屏幕会使元素再次出现。将屏幕返回到原始位置后,错误也被修复,所以我知道这不是我的问题。还有其他人看过这个/解决了吗?

HTML

<div ng-if="fullId===false">{{'postcode-not-enough-info'|translate}}</div>

<div class="question-response select-response-container postcode-dialog">
    <span class="select-display">
        <span ng-if="response"
              class="select-label-pos">{{displayResponse}}</span>

        <span ng-if="!response" class="select-label-pos">{{'postcode-select-address'|translate}}</span>
        <span class="ui-icon down-arrow-icon down-arrow-pos"></span>
    </span>
    <select ng-show="fullId===false" class="question-response-select" ng-change="updateDisplayResponse()" ng-options="item.Text as combined(item) for item in options" ng-model="response">
        <option value>{{'postcode-select-address'|translate}}</option>
    </select>
    <select ng-show="fullId===true" class="question-response-select" ng-change="updateDisplayResponse()" ng-options="item.Id as item.Text for item in options" ng-model="response">
        <option value>{{'postcode-select-address'|translate}}</option>
    </select>
</div>
<div id="action-bar">
    <button ng-click="okay()" class="action third okay">{{'okay'|translate}}</button>
</div>

JS

$scope.updateDisplayResponse = function(){
            if($scope.fullId === true) {
                for (var i = 0; i < $scope.options.length; i++) {
                    if ($scope.response === $scope.options[i].Id) {
                        $scope.displayResponse = $scope.options[i].Text;
                    }
                }
            } else{
                for (var x = 0; x < $scope.options.length; x++) {
                    if ($scope.response === $scope.options[x].Text) {
                        $scope.displayResponse = $scope.options[x].Description.substring(0,$scope.options[x].Description.length-1) + ", " + $scope.options[x].Text;
                    }
                }
            }
        };

0 个答案:

没有答案