Skip to content

Commit 274e524

Browse files
committed
add step 06
1 parent 47a56a9 commit 274e524

File tree

112 files changed

+7404
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+7404
-0
lines changed

step_06/controllers.dart

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
library phonecat;
2+
3+
import 'package:angular/angular.dart';
4+
import 'package:logging/logging.dart';
5+
6+
@NgController(
7+
selector: '[phone-list]',
8+
publishAs: 'ctrl',
9+
map: const {
10+
'phones': '=>phones'
11+
}
12+
)
13+
class PhoneListCtrl {
14+
Http _http;
15+
16+
List<Map> phones = [];
17+
String query = '';
18+
String orderProp = 'age';
19+
20+
PhoneListCtrl(Http this._http) {
21+
this._http.get("./phones/phones.json").then((resp) {
22+
print(resp.data);
23+
this.phones = resp.data;
24+
});
25+
}
26+
}
27+
28+
main() {
29+
Logger.root.level = Level.FINEST;
30+
Logger.root.onRecord.listen((LogRecord r) { print(r.message); });
31+
Module phoneCatModule = new Module()
32+
..type(PhoneListCtrl);
33+
ngBootstrap(module: phoneCatModule);
34+
}

step_06/css/.gitkeep

Whitespace-only changes.

step_06/css/animations.css

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* animations css stylesheet
3+
*/
4+
5+
/* animate ngRepeat in phone listing */
6+
7+
.phone-listing.ng-enter,
8+
.phone-listing.ng-leave,
9+
.phone-listing.ng-move {
10+
-webkit-transition: 0.5s linear all;
11+
-moz-transition: 0.5s linear all;
12+
-o-transition: 0.5s linear all;
13+
transition: 0.5s linear all;
14+
}
15+
16+
.phone-listing.ng-enter,
17+
.phone-listing.ng-move {
18+
opacity: 0;
19+
height: 0;
20+
overflow: hidden;
21+
}
22+
23+
.phone-listing.ng-move.ng-move-active,
24+
.phone-listing.ng-enter.ng-enter-active {
25+
opacity: 1;
26+
height: 120px;
27+
}
28+
29+
.phone-listing.ng-leave {
30+
opacity: 1;
31+
overflow: hidden;
32+
}
33+
34+
.phone-listing.ng-leave.ng-leave-active {
35+
opacity: 0;
36+
height: 0;
37+
padding-top: 0;
38+
padding-bottom: 0;
39+
}
40+
41+
/* cross fading between routes with ngView */
42+
43+
.view-container {
44+
position: relative;
45+
}
46+
47+
.view-frame.ng-enter,
48+
.view-frame.ng-leave {
49+
background: white;
50+
position: absolute;
51+
top: 0;
52+
left: 0;
53+
right: 0;
54+
}
55+
56+
.view-frame.ng-enter {
57+
-webkit-animation: 0.5s fade-in;
58+
-moz-animation: 0.5s fade-in;
59+
-o-animation: 0.5s fade-in;
60+
animation: 0.5s fade-in;
61+
z-index: 100;
62+
}
63+
64+
.view-frame.ng-leave {
65+
-webkit-animation: 0.5s fade-out;
66+
-moz-animation: 0.5s fade-out;
67+
-o-animation: 0.5s fade-out;
68+
animation: 0.5s fade-out;
69+
z-index: 99;
70+
}
71+
72+
@keyframes fade-in {
73+
from { opacity: 0; }
74+
to { opacity: 1; }
75+
}
76+
@-moz-keyframes fade-in {
77+
from { opacity: 0; }
78+
to { opacity: 1; }
79+
}
80+
@-webkit-keyframes fade-in {
81+
from { opacity: 0; }
82+
to { opacity: 1; }
83+
}
84+
85+
@keyframes fade-out {
86+
from { opacity: 1; }
87+
to { opacity: 0; }
88+
}
89+
@-moz-keyframes fade-out {
90+
from { opacity: 1; }
91+
to { opacity: 0; }
92+
}
93+
@-webkit-keyframes fade-out {
94+
from { opacity: 1; }
95+
to { opacity: 0; }
96+
}
97+

step_06/css/app.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* app css stylesheet */
2+
3+
body {
4+
padding-top: 20px;
5+
}
6+
7+
.phones {
8+
list-style: none;
9+
}
10+
11+
.thumb {
12+
float: left;
13+
margin: -1em 1em 1.5em 0em;
14+
padding-bottom: 1em;
15+
height: 100px;
16+
width: 100px;
17+
}
18+
19+
.phones li {
20+
clear: both;
21+
height: 100px;
22+
padding-top: 15px;
23+
}

0 commit comments

Comments
 (0)