-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathangularjs_module.html
More file actions
48 lines (48 loc) · 1.62 KB
/
angularjs_module.html
File metadata and controls
48 lines (48 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AngularJS· Controller</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.css">
<style>
.demo{
margin-bottom:10px;
border-bottom:1px solid #1b926c;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../index.html">首页</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="javascript:void(0)">Link</a></li>
<li><a href="javascript:void(0)">Link2</a></li>
</ul>
</div>
</nav>
</div>
<div class="row demo">
<h3>Demo1-Module</h3>
<div ng-app="myApp">
<div ng-controller="HelloController">
<p>输出:<b>{{user.name}}</b> say, welcome to visit <a href="{{user.website}}" target="_blank">{{user.website}}</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular.js" type="text/javascript"></script>
<script>
var myApp = angular.module('myApp', []); //注意app创建时需要添加第二个参数
myApp.controller('HelloController',function($scope){
$scope.user = {name: '时刻智(ShiKeZhi)',
website:'http://www.shikezhi.com'
};
});
</script>