2017-12-18 111 views
-3

我使用angularJS並希望顯示如下控制器屬性按鈕上的文字:AngularJS顯示內容incorrently

<button>{{object.Text}}</button> 

預期的結果是顯示按鈕的內容是「提交」,但在IOS只顯示「{{object.Text}}」在屏幕上。 Android或桌面瀏覽器顯示正確。

任何人都可以幫忙嗎? 謝謝。

+0

可你能張貼代碼 –

回答

0

這對你很有幫助,如果你發佈你的代碼,我會根據你的問題更新代碼。

var app=angular.module('app', []); 
 
app.controller('testCtrl',function($scope){ 
 
    $scope.object={ 
 
     Text:"Click Me!....", 
 
    }; 
 
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> 
 
<div ng-app="app" ng-strict-di ng-controller="testCtrl"> 
 
<button > {{object.Text}}</button> 
 
</div>