-
Toggle
+
diff --git a/aio/content/examples/pipes/src/app/app.component.html b/aio/content/examples/pipes/src/app/app.component.html
index 09212360761..fd88f9232b5 100644
--- a/aio/content/examples/pipes/src/app/app.component.html
+++ b/aio/content/examples/pipes/src/app/app.component.html
@@ -1,5 +1,4 @@
-
-
Pipes
+
Pipes
Happy Birthday v1
Birthday DatePipe
Happy Birthday v2
@@ -14,13 +13,11 @@
-
-
Hero Birthday v1
+
Hero Birthday v1
-
-
Birthday DatePipe
+
Birthday DatePipe
The hero's birthday is {{ birthday | date }}
@@ -30,13 +27,11 @@
-
-
Hero Birthday v2
+
Hero Birthday v2
-
-
Birthday Pipe Chaining
+
Birthday Pipe Chaining
The chained hero's birthday is
@@ -55,31 +50,24 @@
{{ ( birthday | date:'fullDate' ) | uppercase}}
-
-
+
-
-
loading
+
loading
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
diff --git a/aio/content/examples/property-binding/src/app/app.component.html b/aio/content/examples/property-binding/src/app/app.component.html
index e91b4ee6ee5..8b48e942e12 100644
--- a/aio/content/examples/property-binding/src/app/app.component.html
+++ b/aio/content/examples/property-binding/src/app/app.component.html
@@ -4,7 +4,7 @@
Property Binding with Angular
Binding the src property of an image:
-
![]()
+
@@ -47,8 +47,8 @@
Property binding and interpolation
-
is the interpolated image.
-
is the property bound image.
+
is the interpolated image.
+
is the property bound image.
"{{interpolationTitle}}" is the interpolated title.
"" is the property bound title.
diff --git a/aio/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts b/aio/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts
index cc0f4cfd0df..f4944a7115a 100644
--- a/aio/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts
+++ b/aio/content/examples/reactive-forms/e2e/src/app.e2e-spec.ts
@@ -3,8 +3,8 @@ import { browser, element, by } from 'protractor';
describe('Reactive forms', () => {
const nameEditor = element(by.css('app-name-editor'));
const profileEditor = element(by.css('app-profile-editor'));
- const nameEditorLink = element(by.cssContainingText('app-root > nav > a', 'Name Editor'));
- const profileEditorLink = element(by.cssContainingText('app-root > nav > a', 'Profile Editor'));
+ const nameEditorButton = element(by.cssContainingText('app-root > nav > button', 'Name Editor'));
+ const profileEditorButton = element(by.cssContainingText('app-root > nav > button', 'Profile Editor'));
beforeAll(() => browser.get(''));
@@ -14,7 +14,7 @@ describe('Reactive forms', () => {
const nameText = 'John Smith';
beforeAll(async () => {
- await nameEditorLink.click();
+ await nameEditorButton.click();
});
beforeEach(async () => {
@@ -66,12 +66,12 @@ describe('Reactive forms', () => {
};
beforeAll(async () => {
- await profileEditorLink.click();
+ await profileEditorButton.click();
});
beforeEach(async () => {
await browser.get('');
- await profileEditorLink.click();
+ await profileEditorButton.click();
});
it('should be invalid by default', async () => {
diff --git a/aio/content/examples/reactive-forms/src/app/app.component.css b/aio/content/examples/reactive-forms/src/app/app.component.css
index 0befc361b91..9336f8f4200 100644
--- a/aio/content/examples/reactive-forms/src/app/app.component.css
+++ b/aio/content/examples/reactive-forms/src/app/app.component.css
@@ -1,3 +1,4 @@
-nav a {
+nav button {
padding: 1rem;
+ font-size: inherit;
}
diff --git a/aio/content/examples/reactive-forms/src/app/app.component.html b/aio/content/examples/reactive-forms/src/app/app.component.html
index d3d69112bca..bc1d2fd7b14 100644
--- a/aio/content/examples/reactive-forms/src/app/app.component.html
+++ b/aio/content/examples/reactive-forms/src/app/app.component.html
@@ -1,8 +1,8 @@
Reactive Forms
diff --git a/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.2.html b/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.2.html
deleted file mode 100644
index 70bcaeb1d30..00000000000
--- a/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.2.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
Dashboard
-
-
Session ID: {{ sessionId | async }}
-
-
Token: {{ token | async }}
diff --git a/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.html b/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.html
index 4ba685bc14c..04ff184a5f4 100644
--- a/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.html
+++ b/aio/content/examples/router/src/app/admin/admin-dashboard/admin-dashboard.component.html
@@ -1,7 +1,7 @@
Dashboard
Session ID: {{ sessionId | async }}
-
+
Token: {{ token | async }}
Preloaded Modules
diff --git a/aio/content/examples/set-document-title/src/app/app.component.ts b/aio/content/examples/set-document-title/src/app/app.component.ts
index e4d6671a477..e6e8e2fbc11 100644
--- a/aio/content/examples/set-document-title/src/app/app.component.ts
+++ b/aio/content/examples/set-document-title/src/app/app.component.ts
@@ -12,9 +12,9 @@ import { Title } from '@angular/platform-browser';
`,
})
diff --git a/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.css b/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.css
index f042cd85f73..6a85fc8cb2c 100644
--- a/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.css
+++ b/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.css
@@ -5,27 +5,63 @@
padding: 0;
width: 15em;
}
+
.heroes li {
+ display: flex;
+}
+
+.heroes button {
+ flex: 1;
cursor: pointer;
position: relative;
left: 0;
background-color: #EEE;
margin: .5em;
- padding: .3em 0;
+ padding: 0;
height: 1.6em;
border-radius: 4px;
+ display: flex;
+ align-items: stretch;
+ height: 1.8em;
}
+
+.heroes button:hover {
+ color: #2c3a41;
+ background-color: #e6e6e6;
+ left: .1em;
+}
+
+.heroes button:active {
+ background-color: #525252;
+ color: #fafafa;
+}
+
+.heroes button.selected {
+ background-color: black;
+ color: white;
+}
+
+.heroes button.selected:hover {
+ background-color: #505050;
+ color: white;
+}
+
+.heroes button.selected:active {
+ background-color: black;
+ color: white;
+}
+
.heroes .badge {
display: inline-block;
font-size: small;
color: white;
padding: 0.8em 0.7em 0 0.7em;
- background-color: #607D8B;
+ background-color: #405061;
line-height: 1em;
- position: relative;
- left: -1px;
- top: -4px;
- height: 1.8em;
margin-right: .8em;
border-radius: 4px 0 0 4px;
}
+
+.heroes .name {
+ align-self: center;
+}
diff --git a/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.html b/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.html
index bab05ceb2b2..090451c6168 100644
--- a/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.html
+++ b/aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.html
@@ -2,8 +2,11 @@
My Heroes
- -
- {{hero.id}} {{hero.name}}
+
-
+
diff --git a/aio/content/examples/template-syntax/src/app/app.component.html b/aio/content/examples/template-syntax/src/app/app.component.html
index 5eb77f58836..0e8519ed1ea 100644
--- a/aio/content/examples/template-syntax/src/app/app.component.html
+++ b/aio/content/examples/template-syntax/src/app/app.component.html
@@ -1,6 +1,5 @@
-
-
Template Syntax
+
Template Syntax
Interpolation
Expression context
Statement context
@@ -47,7 +46,7 @@
{{title}}
-
+
@@ -120,7 +119,7 @@
Mental Model
-

+
@@ -140,7 +139,7 @@
-
![]()
+
@@ -181,6 +180,7 @@ button
top
+
Property vs. Attribute (img examples)
@@ -191,7 +191,7 @@ button
![]()
-
+
top
@@ -211,7 +211,7 @@ button
Property Binding
-
![]()
+
[ngClass] binding to the classes property
@@ -221,8 +221,14 @@ button
-
is the interpolated image.
-
is the property bound image.
+
+
+ is the interpolated image.
+
+
+
+ is the property bound image.
+
"{{title}}" is the interpolated title.
"" is the property bound title.
@@ -320,6 +326,8 @@ button
[hero]="currentHero">
+
+
@@ -334,6 +342,8 @@ button
+
+
top
Two-way Binding
@@ -577,7 +587,7 @@ without NgModel
-
![]()
+
@@ -608,7 +618,7 @@ without NgModel
- {{product.price | currency:'USD':'symbol'}}
+ Price: {{product.price | currency:'USD':'symbol'}}
top
diff --git a/aio/content/examples/template-syntax/src/app/hero-detail.component.ts b/aio/content/examples/template-syntax/src/app/hero-detail.component.ts
index f3c7139acd5..df6b936cb77 100644
--- a/aio/content/examples/template-syntax/src/app/hero-detail.component.ts
+++ b/aio/content/examples/template-syntax/src/app/hero-detail.component.ts
@@ -10,7 +10,7 @@ import { Hero } from './hero';
styles: ['button {margin-left: 8px} div {margin: 8px 0} img {height:24px}'],
template: `
-

+
{{prefix}} {{hero.name}}
@@ -38,7 +38,7 @@ export class HeroDetailComponent {
selector: 'app-big-hero-detail',
template: `
-

+
{{hero.name}}
Name: {{hero.name}}
Emotion: {{hero.emotion}}
diff --git a/aio/content/examples/template-syntax/src/app/sizer.component.ts b/aio/content/examples/template-syntax/src/app/sizer.component.ts
index c4443ede515..942ce094206 100644
--- a/aio/content/examples/template-syntax/src/app/sizer.component.ts
+++ b/aio/content/examples/template-syntax/src/app/sizer.component.ts
@@ -7,7 +7,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
-
+ FontSize: {{size}}px
`
})
export class SizerComponent {
diff --git a/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.css b/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.css
index eb54d181d82..d4046cd988e 100644
--- a/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.css
+++ b/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.css
@@ -4,6 +4,7 @@
text-align: center;
color: #eee;
max-height: 120px;
+ width: 100%;
min-width: 120px;
background-color: #607D8B;
border-radius: 2px;
diff --git a/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts b/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts
index 8c55735555c..faf9f17acb7 100644
--- a/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts
+++ b/aio/content/examples/testing/src/app/dashboard/dashboard-hero.component.ts
@@ -7,9 +7,9 @@ import { Hero } from '../model/hero';
@Component({
selector: 'dashboard-hero',
template: `
-
+
+
`,
styleUrls: [ './dashboard-hero.component.css' ]
})
diff --git a/aio/content/examples/testing/src/app/demo/demo.ts b/aio/content/examples/testing/src/app/demo/demo.ts
index 5e375e8e1b5..57107bc8caf 100644
--- a/aio/content/examples/testing/src/app/demo/demo.ts
+++ b/aio/content/examples/testing/src/app/demo/demo.ts
@@ -184,7 +184,7 @@ export class ParentComponent { }
@Component({
selector: 'io-comp',
- template: '
Original {{hero.name}}
'
+ template: '
'
})
export class IoComponent {
@Input() hero!: Hero;
diff --git a/aio/content/examples/testing/src/app/hero/hero-detail.component.html b/aio/content/examples/testing/src/app/hero/hero-detail.component.html
index 7e86a668f6a..aaa8eaae2ae 100644
--- a/aio/content/examples/testing/src/app/hero/hero-detail.component.html
+++ b/aio/content/examples/testing/src/app/hero/hero-detail.component.html
@@ -2,7 +2,7 @@
{{hero.name | titlecase}} Details
- {{hero.id}}
+
id: {{hero.id}}
diff --git a/aio/content/examples/testing/src/app/hero/hero-list.component.css b/aio/content/examples/testing/src/app/hero/hero-list.component.css
index bb24cf0cd6f..ffd66ab8d6f 100644
--- a/aio/content/examples/testing/src/app/hero/hero-list.component.css
+++ b/aio/content/examples/testing/src/app/hero/hero-list.component.css
@@ -2,57 +2,70 @@
background-color: #CFD8DC !important;
color: white;
}
+
.heroes {
margin: 0 0 2em 0;
list-style-type: none;
padding: 0;
width: 15em;
}
+
.heroes li {
+ display: flex;
+}
+
+.heroes button {
+ flex: 1;
cursor: pointer;
position: relative;
left: 0;
background-color: #EEE;
margin: .5em;
- padding: .3em 0;
+ padding: 0;
height: 1.6em;
border-radius: 4px;
+ display: flex;
+ align-items: stretch;
+ height: 1.8em;
}
-.heroes li:hover {
- color: #607D8B;
- background-color: #DDD;
+
+.heroes button:hover {
+ color: #2c3a41;
+ background-color: #e6e6e6;
left: .1em;
}
-.heroes li.selected:hover {
- background-color: #BBD8DC !important;
+
+.heroes button:active {
+ background-color: #525252;
+ color: #fafafa;
+}
+
+.heroes button.selected {
+ background-color: black;
color: white;
}
-.heroes .text {
- position: relative;
- top: -3px;
+
+.heroes button.selected:hover {
+ background-color: #505050;
+ color: white;
}
+
+.heroes button.selected:active {
+ background-color: black;
+ color: white;
+}
+
.heroes .badge {
display: inline-block;
font-size: small;
color: white;
padding: 0.8em 0.7em 0 0.7em;
- background-color: #607D8B;
+ background-color: #405061;
line-height: 1em;
- position: relative;
- left: -1px;
- top: -4px;
- height: 1.8em;
margin-right: .8em;
border-radius: 4px 0 0 4px;
}
-button {
- font-family: Arial, sans-serif;
- background-color: #eee;
- border: none;
- padding: 5px 10px;
- border-radius: 4px;
- cursor: pointer;
-}
-button:hover {
- background-color: #cfd8dc;
+
+.heroes .name {
+ align-self: center;
}
diff --git a/aio/content/examples/testing/src/app/hero/hero-list.component.html b/aio/content/examples/testing/src/app/hero/hero-list.component.html
index cd37301fd6b..dda92c3609f 100644
--- a/aio/content/examples/testing/src/app/hero/hero-list.component.html
+++ b/aio/content/examples/testing/src/app/hero/hero-list.component.html
@@ -1,8 +1,9 @@
My Heroes
- -
- {{hero.id}} {{hero.name}}
+
-
+
diff --git a/aio/content/examples/testing/src/app/hero/hero-list.component.spec.ts b/aio/content/examples/testing/src/app/hero/hero-list.component.spec.ts
index 23d88cd9a79..38048773b55 100644
--- a/aio/content/examples/testing/src/app/hero/hero-list.component.spec.ts
+++ b/aio/content/examples/testing/src/app/hero/hero-list.component.spec.ts
@@ -56,11 +56,11 @@ describe('HeroListComponent', () => {
it('should select hero on click', fakeAsync(() => {
const expectedHero = HEROES[1];
- const li = page.heroRows[1];
+ const btn = page.heroRows[1].querySelector('button');
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
- li.dispatchEvent(new Event('click'));
+ btn!.dispatchEvent(new Event('click'));
tick();
// `.toEqual` because selectedHero is clone of expectedHero; see FakeHeroService
expect(comp.selectedHero).toEqual(expectedHero);
@@ -68,11 +68,11 @@ describe('HeroListComponent', () => {
it('should navigate to selected hero detail on click', fakeAsync(() => {
const expectedHero = HEROES[1];
- const li = page.heroRows[1];
+ const btn = page.heroRows[1].querySelector('button');
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
- li.dispatchEvent(new Event('click'));
+ btn!.dispatchEvent(new Event('click'));
tick();
// should have navigated
diff --git a/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts b/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts
index 9a25932f367..48571bd8af5 100644
--- a/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts
+++ b/aio/content/examples/toh-pt2/e2e/src/app.e2e-spec.ts
@@ -66,7 +66,7 @@ function initialPageTests() {
function selectHeroTests() {
it(`selects ${targetHero.name} from hero list`, async () => {
- const hero = element(by.cssContainingText('li span.badge', targetHero.id.toString()));
+ const hero = element(by.cssContainingText('button span.badge', targetHero.id.toString()));
await hero.click();
// Nothing specific to expect other than lack of exceptions.
});
@@ -74,7 +74,7 @@ function selectHeroTests() {
it(`has selected ${targetHero.name}`, async () => {
const page = getPageElts();
const expectedText = `${targetHero.id} ${targetHero.name}`;
- expect(await page.selected.getText()).toBe(expectedText);
+ expect((await page.selected.getText()).replace('\n', ' ')).toBe(expectedText);
});
it('shows selected hero details', async () => {
@@ -101,7 +101,7 @@ function updateHeroTests() {
it(`shows updated hero name in list`, async () => {
const page = getPageElts();
- const hero = Hero.fromString(await page.selected.getText());
+ const hero = Hero.fromString((await page.selected.getText()).replace('\n', ' '));
const newName = targetHero.name + nameSuffix;
expect(hero.id).toEqual(targetHero.id);
expect(hero.name).toEqual(newName);
@@ -122,8 +122,8 @@ async function expectHeading(hLevel: number, expectedText: string): Promise
div, app-root > app-heroes > div'))
};
}
diff --git a/aio/content/examples/toh-pt2/src/app/heroes/heroes.component.1.html b/aio/content/examples/toh-pt2/src/app/heroes/heroes.component.1.html
index fe140484f54..3b77cd1689c 100644
--- a/aio/content/examples/toh-pt2/src/app/heroes/heroes.component.1.html
+++ b/aio/content/examples/toh-pt2/src/app/heroes/heroes.component.1.html
@@ -12,7 +12,8 @@
-
+
+