<!DOCTYPE html>
<html id="ng-app" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<title></title>
<script>
(function{
'use strict'; // 严格模式
var myApp = angular.module('myApp',['IndexModule']) // 定义一个模块 ,子模块会在主模版中引入,主模块会在ng-app里面写入(子模块,在html里面不会出现的。
// 子模块只是为了功能划分。然后子模块内创建一个个的controller,controller会在页面中引入)
var IndexModule = angular.module('IndexModule',[]); // 声明一个子模块,子模块会在主模块内引入
IndexModule.controller('IndexCtrl',['$scope', function($scope){ // 定义一个cortroller ,在页面引用,可以创建多个,采用依赖注入的方式,注入$scope对象
$scope.title=" 破破美丽的星期六 " // 数据绑定
}
])
})
</script>
</head>
<body ng-controller="IndexCtrl">
<div class="title">{{title}}</div>
<script type="text/javascript" src="jquery.min.js" ></script>
<script type="text/javascript" src="angular.min.js" ></script>
<script type="text/javascript" src="angular-animate.min.js" ></script>
</body>
</html>