AngularJs学习日记[2]:ng-bind

如原来利用双层花括号“{{.....}}”输出是这样的:

<!DOCTYPE html>
<html>
<body>

<div ng-app="">

<p>Name: <input type="text" ng-model="name"></p>
<p>You wrote: {{ name }}</p> 

</div>	

<script type="text/javascript" src="angular.min.js"></script>

</body>
</html>

改用ng-bind之后就这样:

<!DOCTYPE html>
<html>
<body>

<div ng-app="">

<p>Name: <input type="text" ng-model="name"></p>
<p>You wrote: <span ng-bind="name"></span></p> 

</div>	

<script type="text/javascript" src="angular.min.js"></script>

</body>
</html>

参考文献:http://www.w3schools.com/angular/default.asp

你可能感兴趣的:(AngularJs学习日记[2]:ng-bind)