anjularjs 指令(1)

ng-app:初始化一个anjularjs应用程序,一个网页可以包含多个运行在不同元素中的anjularjs应用程序

ng-init:初始化应用程序的数据

ng-model: 把元素值绑定到应用程序

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ng-app指令</title>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="firstName='luo'">
<input type="text" ng-model="firstName" />
<p>您输入的名字为:{{firstName}}</p>
</div>
</body>
</html>

原文地址:https://www.cnblogs.com/debra/p/6031241.html