Skip to content

Commit cb61dfd

Browse files
committed
Update angular-controller-example
1 parent b1b742d commit cb61dfd

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

angular-controller-example/app.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Created by hoangnn on 29/10/2015.
3+
*/
4+
(function() {
5+
6+
var app = angular.module('Store', []);
7+
8+
app.controller('StoreController', function() {
9+
this.product = tablet;
10+
});
11+
12+
var tablet = {
13+
name: 'iPad Air 2 64G',
14+
price: 499,
15+
description: 'The newest Apple iPad.'
16+
}
17+
18+
})();

angular-controller-example/index.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html ng-app="Store">
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title>angular-controller-example</title>
6+
7+
<!-- Vendor -->
8+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
9+
</head>
10+
<body>
11+
12+
<div ng-controller="StoreController as store">
13+
<h1>{{store.product.name}}</h1>
14+
<h2>$ {{store.product.price}}</h2>
15+
<p>{{store.product.description}}</p>
16+
</div>
17+
18+
<!-- Vendor -->
19+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
20+
21+
<!-- Application -->
22+
<script src="app.js"></script>
23+
</body>
24+
</html>

0 commit comments

Comments
 (0)