-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathangularjs_controller.html
More file actions
66 lines (66 loc) · 2.3 KB
/
angularjs_controller.html
File metadata and controls
66 lines (66 loc) · 2.3 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<title>AngularJS· Controller</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.css">
<link rel="stylesheet" href="../static/js/prettify/prettify.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-Controller</h3>
<pre>
var myApp = angular.module('myApp', []); //注意app创建时需要添加第二个参数
myApp.controller('HelloController',function($scope){
$scope.user = {name: '时刻智(ShiKeZhi)',
website:'http://www.shikezhi.com'
};
});
</pre>
<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>
</body>
</html>
<script src="http://cdn.bootcss.com/jquery/2.1.3/jquery.min.js" type="text/javascript"></script>
<script src="http://cdn.bootcss.com/angular.js/1.3.8/angular.js" type="text/javascript"></script>
<script src="../static/js/prettify/prettify.min.js"></script>
<script>
/**
* pretiffy美化代码
*/
$(function() {
$('pre').addClass('prettyprint linenums').attr('style', 'overflow:auto');
window.prettyPrint && prettyPrint();
});
</script>
<script>
var myApp = angular.module('myApp', []); //注意app创建时需要添加第二个参数
myApp.controller('HelloController',function($scope){
$scope.user = {name: '时刻智(ShiKeZhi)',
website:'http://www.shikezhi.com'
};
});
</script>