Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit f9ea886

Browse files
petebacondarwingkalpak
authored andcommitted
step-8 Templating Links & Images
- Add a phone image and links to phone pages. - Add an end-to-end test that verifies the phone links. - Tweak the CSS to style the page just a notch.
1 parent b61169c commit f9ea886

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

app/app.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,20 @@ body {
22
padding-top: 20px;
33
}
44

5+
.phones {
6+
list-style: none;
7+
}
8+
9+
.phones li {
10+
clear: both;
11+
height: 115px;
12+
padding-top: 15px;
13+
}
14+
15+
.thumb {
16+
float: left;
17+
height: 100px;
18+
margin: -0.5em 1em 1.5em 0;
19+
padding-bottom: 1em;
20+
width: 100px;
21+
}

app/phone-list/phone-list.template.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
<!--Body content-->
2222

2323
<ul class="phones">
24-
<li ng-repeat="phone in $ctrl.phones | filter:$ctrl.query | orderBy:$ctrl.orderProp">
25-
<span>{{phone.name}}</span>
24+
<li ng-repeat="phone in $ctrl.phones | filter:$ctrl.query | orderBy:$ctrl.orderProp" class="thumbnail">
25+
<a href="#!/phones/{{phone.id}}" class="thumb">
26+
<img ng-src="{{phone.imageUrl}}" alt="{{phone.name}}" />
27+
</a>
28+
<a href="#!/phones/{{phone.id}}">{{phone.name}}</a>
2629
<p>{{phone.snippet}}</p>
2730
</li>
2831
</ul>

e2e-tests/scenarios.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ describe('PhoneCat Application', function() {
5252
]);
5353
});
5454

55+
it('should render phone specific links', function() {
56+
var query = element(by.model('$ctrl.query'));
57+
query.sendKeys('nexus');
58+
59+
element.all(by.css('.phones li a')).first().click();
60+
expect(browser.getCurrentUrl()).toContain('index.html#!/phones/nexus-s');
61+
});
62+
5563
});
5664

5765
});

0 commit comments

Comments
 (0)