1.概念:
一个应用(APP,本身也是一个大模块)是由若干个模块(module)组成的,每个模块实现一个功能。利于代码的复用。
2.基本书写格式
<!DOCTYPE html>
<html lang="en" ng-app='App'>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div ng-controller='myController'>
<h1>angular基本结构</h1>
<ul>
<li ng-bind='arr[0].name' ></li>
<li ng-bind='arr[0].age' ></li>
</ul>
</div>
</body>
<script src = 'angular.min.js'></script>
<script>
var app = angular.module('App',[]);
app.controller('myController',['$scope',function ($scope) {
$scope.arr = [
{
name:'狗剩',
age:'3'
},
{
name:'铁柱',
age:'2'
}
]
}])
</script>
</html>