Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e2477ed

Browse files
Add built-in directive p2
1 parent 72d871a commit e2477ed

File tree

5 files changed

+70
-13
lines changed

5 files changed

+70
-13
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
angular-builtin-directive-p2.iml

‎angular-builtin-directive-p2/app.js‎

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,52 @@
1111

1212
var products = [
1313
{
14-
name: 'Apple iPad Air 2 64G',
14+
name: 'Apple iPad Air 2 Wifi/4G 16G',
1515
price: 499,
16-
description: 'Apple iPad Air 2 ra mắt là chiếc máy tính bảng 9.7 inch mỏng và nhẹ nhất hiện nay',
17-
inStock: true
16+
description: 'Một bước ngoặt trong thiết kế của Apple vừa tinh tế, vừa sang trọng và thời thượng và những cải tiến đáng giá. Apple iPad Air 2 ra mắt là chiếc máy tính bảng 9.7 inch mỏng và nhẹ nhất hiện nay',
17+
inStock: true,
18+
images: [
19+
{
20+
full: "images/ipad.png",
21+
thumb: "images/ipad.png"
22+
},
23+
{
24+
full: "images/ipad.png",
25+
thumb: "images/ipad.png"
26+
}
27+
]
1828
},
1929
{
20-
name: 'Apple iPhone 6s',
30+
name: 'Apple iPad Air 2 Wifi/4G 64G',
2131
price: 599,
22-
description: 'Một bước ngoặt trong thiết kế của Apple vừa tinh tế, vừa sang trọng và thời thượng và những cải tiến đáng giá',
23-
inStock: false
32+
description: 'Một bước ngoặt trong thiết kế của Apple vừa tinh tế, vừa sang trọng và thời thượng và những cải tiến đáng giá. Apple iPad Air 2 ra mắt là chiếc máy tính bảng 9.7 inch mỏng và nhẹ nhất hiện nay',
33+
inStock: true,
34+
images: [
35+
{
36+
full: "images/ipad.png",
37+
thumb: "images/ipad.png"
38+
},
39+
{
40+
full: "images/ipad.png",
41+
thumb: "images/ipad.png"
42+
}
43+
]
2444
},
2545
{
26-
name: 'Apple iPhone 6s Plus',
46+
name: 'Apple iPad Air 2 Wifi/4G 128G',
2747
price: 699,
28-
description: 'Một bước ngoặt trong thiết kế của Apple vừa tinh tế, vừa sang trọng và thời thượng và những cải tiến đáng giá',
29-
inStock: true
48+
description: 'Một bước ngoặt trong thiết kế của Apple vừa tinh tế, vừa sang trọng và thời thượng và những cải tiến đáng giá. Apple iPad Air 2 ra mắt là chiếc máy tính bảng 9.7 inch mỏng và nhẹ nhất hiện nay',
49+
inStock: true,
50+
images: [
51+
{
52+
full: "images/ipad.png",
53+
thumb: "images/ipad.png"
54+
},
55+
{
56+
full: "images/ipad.png",
57+
thumb: "images/ipad.png"
58+
}
59+
]
3060
}
3161
]
3262

30.5 KB
Loading[フレーム]
36.8 KB
Loading[フレーム]

‎angular-builtin-directive-p2/index.html‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,44 @@
1313

1414
<div class="container">
1515
<div class="page-header"></div>
16-
<div class="panel panel-default col-md-5" ng-controller="StoreController as store">
17-
<div class="panel-body" ng-repeat="product in store.products">
16+
<div class="panel panel-default col-md-12" ng-controller="StoreController as store">
17+
<div class="panel-body col-md-4" ng-repeat="product in store.products">
1818
<h1>{{product.name}}</h1>
1919

20+
<div class="thumbnail">
21+
<img ng-src="{{product.images[0].thumb}}">
22+
</div>
23+
2024
<h2>$ {{product.price}}</h2>
2125

22-
<p>{{product.description}}</p>
2326
<button class="btn btn-primary" ng-show="product.inStock">Thêm vào giỏ</button>
27+
28+
<section ng-init="tab = 1">
29+
<ul class="nav nav-pills">
30+
<li><a ng-click="tab = 1" href>Giới thiệu</a></li>
31+
<li><a ng-click="tab = 2" href>Cấu hình</a></li>
32+
<li><a ng-click="tab = 3" href>Đánh giá</a></li>
33+
</ul>
34+
<div class="panel" ng-show="tab === 1">
35+
<h4>Giới thiệu</h4>
36+
37+
<p>{{product.description}}</p>
38+
</div>
39+
<div class="panel" ng-show="tab === 2">
40+
<h4>Cấu hình</h4>
41+
42+
<p>None yet</p>
43+
</div>
44+
<div class="panel" ng-show="tab === 3">
45+
<h4>Đánh giá</h4>
46+
47+
<p>None yet</p>
48+
</div>
49+
</section>
2450
</div>
2551
</div>
2652
</div>
2753

28-
2954
<!-- Vendor -->
3055
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
3156

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /