2017-04-12 34 views

回答

0

您可以使用::进行一次性绑定。就像这样:

// HTML 
{{::someVar}} 
0

试试这个

<!DOCTYPE html> 
 
<html> 
 
<head> 
 

 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script> 
 
    <script type="text/javascript"> 
 

 

 
    angular.module("app",[]) 
 
    .controller("ctrl",function($scope){ 
 
     $scope.value = 'temp Value'; 
 

 

 
    }); 
 

 
</script> 
 
</head> 
 
<body ng-app="app" ng-controller="ctrl"> 
 
    {{::value}} 
 
</body> 
 
</html>

相关问题