diff --git a/aio/content/examples/.gitignore b/aio/content/examples/.gitignore
index 7833b847ed4..5a298caef96 100644
--- a/aio/content/examples/.gitignore
+++ b/aio/content/examples/.gitignore
@@ -1,8 +1,22 @@
# boilerplate files
+**/src/environments/environment.prod.ts
+**/src/environments/environment.ts
+**/src/assets/.gitkeep
**/src/styles.css
**/src/systemjs-angular-loader.js
**/src/systemjs.config.js
**/src/tsconfig.json
+**/src/favicon.ico
+**/src/polyfills.ts
+**/src/test.ts
+**/src/tsconfig.app.json
+**/src/tsconfig.spec.json
+**/src/typings.d.ts
+**/e2e/app.po.ts
+**/e2e/tsconfig.e2e.json
+**/.angular-cli.json
+**/.editorconfig
+**/tsconfig.json
**/bs-config.e2e.json
**/bs-config.json
**/package.json
@@ -53,14 +67,18 @@ dist/
# testing
!testing/src/browser-test-shim.js
-!testing/karma*.js
# webpack
!webpack/**/config/*.js
!webpack/**/*webpack*.js
+!webpack/src/polyfills.ts
# styleguide
!styleguide/src/systemjs.custom.js
# plunkers
*plnkr.no-link.html
+
+# ngUpgrade testing
+!upgrade-phonecat-*/**/karma.conf.js
+!upgrade-phonecat-*/**/karma-test-shim.js
diff --git a/aio/content/examples/ajs-quick-reference/e2e-spec.ts b/aio/content/examples/ajs-quick-reference/e2e/app.e2e-spec.ts
similarity index 94%
rename from aio/content/examples/ajs-quick-reference/e2e-spec.ts
rename to aio/content/examples/ajs-quick-reference/e2e/app.e2e-spec.ts
index 81a5faa5e75..e27f56e68b8 100644
--- a/aio/content/examples/ajs-quick-reference/e2e-spec.ts
+++ b/aio/content/examples/ajs-quick-reference/e2e/app.e2e-spec.ts
@@ -83,7 +83,7 @@ describe('AngularJS to Angular Quick Reference Tests', function () {
}
function testPosterButtonClick(expectedButtonText: string, isDisplayed: boolean) {
- let posterButton = element(by.css('movie-list tr > th > button'));
+ let posterButton = element(by.css('app-movie-list tr > th > button'));
expect(posterButton.getText()).toBe(expectedButtonText);
posterButton.click().then(function () {
@@ -92,11 +92,11 @@ describe('AngularJS to Angular Quick Reference Tests', function () {
}
function getMovieRows() {
- return element.all(by.css('movie-list tbody > tr'));
+ return element.all(by.css('app-movie-list tbody > tr'));
}
function testFavoriteHero(heroName: string, expectedLabel: string) {
- let movieListComp = element(by.tagName('movie-list'));
+ let movieListComp = element(by.tagName('app-movie-list'));
let heroInput = movieListComp.element(by.tagName('input'));
let favoriteHeroLabel = movieListComp.element(by.tagName('h3'));
let resultLabel = movieListComp.element(by.css('span > p'));
diff --git a/aio/content/examples/ajs-quick-reference/src/app/app.component.ts b/aio/content/examples/ajs-quick-reference/src/app/app.component.ts
index 91091026adf..6c5de8624e4 100644
--- a/aio/content/examples/ajs-quick-reference/src/app/app.component.ts
+++ b/aio/content/examples/ajs-quick-reference/src/app/app.component.ts
@@ -4,7 +4,7 @@ import { MovieService } from './movie.service';
import { IMovie } from './movie';
@Component({
- selector: 'my-app',
+ selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ],
providers: [ MovieService ]
diff --git a/aio/content/examples/ajs-quick-reference/src/app/movie-list.component.ts b/aio/content/examples/ajs-quick-reference/src/app/movie-list.component.ts
index fa71f7a7abd..9955550c8d1 100644
--- a/aio/content/examples/ajs-quick-reference/src/app/movie-list.component.ts
+++ b/aio/content/examples/ajs-quick-reference/src/app/movie-list.component.ts
@@ -8,7 +8,7 @@ import { MovieService } from './movie.service';
// #docregion component
@Component({
- selector: 'movie-list',
+ selector: 'app-movie-list',
templateUrl: './movie-list.component.html',
// #docregion style-url
styleUrls: [ './movie-list.component.css' ],
diff --git a/aio/content/examples/ajs-quick-reference/src/app/movie.service.ts b/aio/content/examples/ajs-quick-reference/src/app/movie.service.ts
index 404fd4454ce..887774d5706 100644
--- a/aio/content/examples/ajs-quick-reference/src/app/movie.service.ts
+++ b/aio/content/examples/ajs-quick-reference/src/app/movie.service.ts
@@ -8,7 +8,7 @@ export class MovieService {
return [
{
hero: 'Celeritas',
- imageurl: 'images/hero.png',
+ imageurl: 'assets/images/hero.png',
movieId: 1,
mpaa: 'pg-13',
releaseDate: '2015-12-19T00:00:00',
@@ -19,7 +19,7 @@ export class MovieService {
},
{
hero: 'Mr. Nice',
- imageurl: 'images/villain.png',
+ imageurl: 'assets/images/villain.png',
movieId: 2,
mpaa: 'pg-13',
releaseDate: '2015-12-18T00:00:00',
@@ -30,7 +30,7 @@ export class MovieService {
},
{
hero: 'Angular',
- imageurl: 'images/ng-logo.png',
+ imageurl: 'assets/images/ng-logo.png',
movieId: 3,
mpaa: 'pg-13',
releaseDate: '2015-12-17T00:00:00',
diff --git a/aio/content/examples/ajs-quick-reference/src/images/hero.png b/aio/content/examples/ajs-quick-reference/src/assets/images/hero.png
similarity index 100%
rename from aio/content/examples/ajs-quick-reference/src/images/hero.png
rename to aio/content/examples/ajs-quick-reference/src/assets/images/hero.png
diff --git a/aio/content/examples/ajs-quick-reference/src/images/ng-logo.png b/aio/content/examples/ajs-quick-reference/src/assets/images/ng-logo.png
similarity index 100%
rename from aio/content/examples/ajs-quick-reference/src/images/ng-logo.png
rename to aio/content/examples/ajs-quick-reference/src/assets/images/ng-logo.png
diff --git a/aio/content/examples/ajs-quick-reference/src/images/villain.png b/aio/content/examples/ajs-quick-reference/src/assets/images/villain.png
similarity index 100%
rename from aio/content/examples/ajs-quick-reference/src/images/villain.png
rename to aio/content/examples/ajs-quick-reference/src/assets/images/villain.png
diff --git a/aio/content/examples/ajs-quick-reference/src/index.html b/aio/content/examples/ajs-quick-reference/src/index.html
index 829f080ae33..9f786cb6aa9 100644
--- a/aio/content/examples/ajs-quick-reference/src/index.html
+++ b/aio/content/examples/ajs-quick-reference/src/index.html
@@ -1,5 +1,5 @@
-
+
@@ -8,21 +8,10 @@
-
-
-
-
-
-
-
-
-
- Loading app...
+
diff --git a/aio/content/examples/ajs-quick-reference/src/main.ts b/aio/content/examples/ajs-quick-reference/src/main.ts
index 6b6532d428a..0740658908d 100644
--- a/aio/content/examples/ajs-quick-reference/src/main.ts
+++ b/aio/content/examples/ajs-quick-reference/src/main.ts
@@ -1,5 +1,12 @@
// #docregion
+import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/aio/content/examples/animations/e2e-spec.ts b/aio/content/examples/animations/e2e/app.e2e-spec.ts
similarity index 92%
rename from aio/content/examples/animations/e2e-spec.ts
rename to aio/content/examples/animations/e2e/app.e2e-spec.ts
index 4fba7ec4755..fc0f40f9fc4 100644
--- a/aio/content/examples/animations/e2e-spec.ts
+++ b/aio/content/examples/animations/e2e/app.e2e-spec.ts
@@ -29,7 +29,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-basic'));
+ host = element(by.css('app-hero-list-basic'));
});
it('animates between active and inactive', () => {
@@ -58,7 +58,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(function() {
- host = element(by.css('hero-list-inline-styles'));
+ host = element(by.css('app-hero-list-inline-styles'));
});
it('are not kept after animation', () => {
@@ -79,7 +79,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-combined-transitions'));
+ host = element(by.css('app-hero-list-combined-transitions'));
});
it('animates between active and inactive', () => {
@@ -108,7 +108,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-twoway'));
+ host = element(by.css('app-hero-list-twoway'));
});
it('animates between active and inactive', () => {
@@ -137,7 +137,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-enter-leave'));
+ host = element(by.css('app-hero-list-enter-leave'));
});
it('adds and removes element', () => {
@@ -157,7 +157,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(function() {
- host = element(by.css('hero-list-enter-leave-states'));
+ host = element(by.css('app-hero-list-enter-leave-states'));
});
it('adds and removes and animates between active and inactive', () => {
@@ -186,7 +186,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(function() {
- host = element(by.css('hero-list-auto'));
+ host = element(by.css('app-hero-list-auto'));
});
it('adds and removes element', () => {
@@ -206,7 +206,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-timings'));
+ host = element(by.css('app-hero-list-timings'));
});
it('adds and removes element', () => {
@@ -227,7 +227,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-multistep'));
+ host = element(by.css('app-hero-list-multistep'));
});
it('adds and removes element', () => {
@@ -248,7 +248,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-groups'));
+ host = element(by.css('app-hero-list-groups'));
});
it('adds and removes element', () => {
@@ -269,7 +269,7 @@ describe('Animation Tests', () => {
let host: ElementFinder;
beforeEach(() => {
- host = element(by.css('hero-list-basic'));
+ host = element(by.css('app-hero-list-basic'));
});
it('animates between active and inactive', () => {
diff --git a/aio/content/examples/animations/src/app/hero-list-auto.component.ts b/aio/content/examples/animations/src/app/hero-list-auto.component.ts
index 6c9b70ff4d0..97a5ff99dec 100644
--- a/aio/content/examples/animations/src/app/hero-list-auto.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-auto.component.ts
@@ -13,7 +13,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-auto',
+ selector: 'app-hero-list-auto',
// #docregion template
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-basic.component.ts b/aio/content/examples/animations/src/app/hero-list-basic.component.ts
index f3a5856d9de..ce23628d6f0 100644
--- a/aio/content/examples/animations/src/app/hero-list-basic.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-basic.component.ts
@@ -17,7 +17,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-basic',
+ selector: 'app-hero-list-basic',
// #enddocregion
/* The click event calls hero.toggleState(), which
* causes the state of that hero to switch from
diff --git a/aio/content/examples/animations/src/app/hero-list-combined-transitions.component.ts b/aio/content/examples/animations/src/app/hero-list-combined-transitions.component.ts
index cfac09b8259..2811254c815 100644
--- a/aio/content/examples/animations/src/app/hero-list-combined-transitions.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-combined-transitions.component.ts
@@ -16,7 +16,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-combined-transitions',
+ selector: 'app-hero-list-combined-transitions',
// #docregion template
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-enter-leave-states.component.ts b/aio/content/examples/animations/src/app/hero-list-enter-leave-states.component.ts
index 1b5b1000f45..291234dab9a 100644
--- a/aio/content/examples/animations/src/app/hero-list-enter-leave-states.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-enter-leave-states.component.ts
@@ -13,7 +13,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-enter-leave-states',
+ selector: 'app-hero-list-enter-leave-states',
// #docregion template
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-enter-leave.component.ts b/aio/content/examples/animations/src/app/hero-list-enter-leave.component.ts
index 3eed1568731..0a888698c31 100644
--- a/aio/content/examples/animations/src/app/hero-list-enter-leave.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-enter-leave.component.ts
@@ -13,7 +13,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-enter-leave',
+ selector: 'app-hero-list-enter-leave',
// #docregion template
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-groups.component.ts b/aio/content/examples/animations/src/app/hero-list-groups.component.ts
index 34fd8c207f2..d17b47d213d 100644
--- a/aio/content/examples/animations/src/app/hero-list-groups.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-groups.component.ts
@@ -14,7 +14,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-groups',
+ selector: 'app-hero-list-groups',
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-multistep.component.ts b/aio/content/examples/animations/src/app/hero-list-multistep.component.ts
index f3aad073ab5..7e77bff1a46 100644
--- a/aio/content/examples/animations/src/app/hero-list-multistep.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-multistep.component.ts
@@ -15,7 +15,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-multistep',
+ selector: 'app-hero-list-multistep',
// #docregion template
template: `
diff --git a/aio/content/examples/animations/src/app/hero-list-timings.component.ts b/aio/content/examples/animations/src/app/hero-list-timings.component.ts
index 305cf784877..b410c22cb93 100644
--- a/aio/content/examples/animations/src/app/hero-list-timings.component.ts
+++ b/aio/content/examples/animations/src/app/hero-list-timings.component.ts
@@ -13,7 +13,7 @@ import {
import { Hero } from './hero.service';
@Component({
- selector: 'hero-list-timings',
+ selector: 'app-hero-list-timings',
template: `
diff --git a/aio/content/examples/animations/src/app/hero-team-builder.component.ts b/aio/content/examples/animations/src/app/hero-team-builder.component.ts
index a46c41dcf07..8a1904ea4f6 100644
--- a/aio/content/examples/animations/src/app/hero-team-builder.component.ts
+++ b/aio/content/examples/animations/src/app/hero-team-builder.component.ts
@@ -3,7 +3,7 @@ import { Component } from '@angular/core';
import { Hero, HeroService } from './hero.service';
@Component({
- selector: 'hero-team-builder',
+ selector: 'app-root',
template: `
@@ -45,27 +45,27 @@ import { Hero, HeroService } from './hero.service';
Enter and leave animations combined with active/inactive state animations.
Different enter and leave transitions depending on state.
-
+
Auto Style Calc
Leave animation from the current computed height using the auto-style value *.
-
+
Different Timings
Enter and leave animations with different easings, ease-in for enter, ease-out for leave.
-
+
Multiple Keyframes
Enter and leave animations with three keyframes in each, to give the transition some bounce.
-
+
Parallel Groups
Enter and leave animations with multiple properties animated in parallel with different timings.
-
+
`,
diff --git a/aio/content/examples/animations/src/index.html b/aio/content/examples/animations/src/index.html
index 74a397e7d15..766957f2343 100644
--- a/aio/content/examples/animations/src/index.html
+++ b/aio/content/examples/animations/src/index.html
@@ -5,26 +5,14 @@
Animations
-
-
-
-
-
-
-
-
-
-
External H1 Title for E2E test
-
+
External button for E2E test
External list for E2E test
diff --git a/aio/content/examples/animations/src/main.ts b/aio/content/examples/animations/src/main.ts
index f22933ba8ed..a9ca1caf8ce 100644
--- a/aio/content/examples/animations/src/main.ts
+++ b/aio/content/examples/animations/src/main.ts
@@ -1,4 +1,11 @@
+import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/aio/content/examples/aot-compiler/example-config.json b/aio/content/examples/aot-compiler/example-config.json
index 473b80a5729..1bbaaad5301 100644
--- a/aio/content/examples/aot-compiler/example-config.json
+++ b/aio/content/examples/aot-compiler/example-config.json
@@ -1,3 +1,4 @@
{
- "build": "build:aot"
+ "build": "build:aot",
+ "projectType": "systemjs"
}
diff --git a/aio/content/examples/aot-compiler/src/index-jit.html b/aio/content/examples/aot-compiler/src/index-jit.html
index 713a04970e1..db41485320e 100644
--- a/aio/content/examples/aot-compiler/src/index-jit.html
+++ b/aio/content/examples/aot-compiler/src/index-jit.html
@@ -1,6 +1,6 @@
-
+
Ahead of time compilation (JIT)
diff --git a/aio/content/examples/aot-compiler/src/index.html b/aio/content/examples/aot-compiler/src/index.html
index 09e5f0de0ed..c79a60dd1b6 100644
--- a/aio/content/examples/aot-compiler/src/index.html
+++ b/aio/content/examples/aot-compiler/src/index.html
@@ -1,6 +1,6 @@
-
+
Ahead of time compilation
diff --git a/aio/content/examples/architecture/e2e-spec.ts b/aio/content/examples/architecture/e2e/app.e2e-spec.ts
similarity index 91%
rename from aio/content/examples/architecture/e2e-spec.ts
rename to aio/content/examples/architecture/e2e/app.e2e-spec.ts
index a5aa78f4fce..8ad5c9ab741 100644
--- a/aio/content/examples/architecture/e2e-spec.ts
+++ b/aio/content/examples/architecture/e2e/app.e2e-spec.ts
@@ -79,10 +79,10 @@ function salesTaxTests() {
function getPageElts() {
return {
- heroes: element.all(by.css('my-app li')),
- heroDetail: element(by.css('my-app hero-detail')),
- salesTaxAmountInput: element(by.css('my-app sales-tax input')),
- salesTaxDetail: element(by.css('my-app sales-tax div'))
+ heroes: element.all(by.css('app-root li')),
+ heroDetail: element(by.css('app-root app-hero-detail')),
+ salesTaxAmountInput: element(by.css('app-root app-sales-tax input')),
+ salesTaxDetail: element(by.css('app-root app-sales-tax div'))
};
}
diff --git a/aio/content/examples/architecture/src/app/app.component.ts b/aio/content/examples/architecture/src/app/app.component.ts
index b987f17e446..b250b678a20 100644
--- a/aio/content/examples/architecture/src/app/app.component.ts
+++ b/aio/content/examples/architecture/src/app/app.component.ts
@@ -3,10 +3,10 @@ import { Component } from '@angular/core';
// #enddocregion import
@Component({
- selector: 'my-app',
+ selector: 'app-root',
template: `
-
-
+
+
`
})
// #docregion export
diff --git a/aio/content/examples/architecture/src/app/hero-detail.component.ts b/aio/content/examples/architecture/src/app/hero-detail.component.ts
index b75d6dd225a..349c118bf1d 100644
--- a/aio/content/examples/architecture/src/app/hero-detail.component.ts
+++ b/aio/content/examples/architecture/src/app/hero-detail.component.ts
@@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core';
import { Hero } from './hero';
@Component({
- selector: 'hero-detail',
+ selector: 'app-hero-detail',
templateUrl: './hero-detail.component.html'
})
export class HeroDetailComponent {
diff --git a/aio/content/examples/architecture/src/app/hero-list.component.1.html b/aio/content/examples/architecture/src/app/hero-list.component.1.html
index c6e6dd51337..9533a287bc7 100644
--- a/aio/content/examples/architecture/src/app/hero-list.component.1.html
+++ b/aio/content/examples/architecture/src/app/hero-list.component.1.html
@@ -1,9 +1,9 @@
{{hero.name}}
-
+
-
+
diff --git a/aio/content/examples/architecture/src/app/hero-list.component.html b/aio/content/examples/architecture/src/app/hero-list.component.html
index b46a307bd37..8f0433fe54b 100644
--- a/aio/content/examples/architecture/src/app/hero-list.component.html
+++ b/aio/content/examples/architecture/src/app/hero-list.component.html
@@ -8,4 +8,4 @@
-
+
diff --git a/aio/content/examples/architecture/src/app/hero-list.component.ts b/aio/content/examples/architecture/src/app/hero-list.component.ts
index a3d372f00ba..4dc0b8e2f34 100644
--- a/aio/content/examples/architecture/src/app/hero-list.component.ts
+++ b/aio/content/examples/architecture/src/app/hero-list.component.ts
@@ -5,7 +5,7 @@ import { HeroService } from './hero.service';
// #docregion metadata, providers
@Component({
- selector: 'hero-list',
+ selector: 'app-hero-list',
templateUrl: './hero-list.component.html',
providers: [ HeroService ]
})
diff --git a/aio/content/examples/architecture/src/app/sales-tax.component.ts b/aio/content/examples/architecture/src/app/sales-tax.component.ts
index 02201afe05e..bc92a8209e6 100644
--- a/aio/content/examples/architecture/src/app/sales-tax.component.ts
+++ b/aio/content/examples/architecture/src/app/sales-tax.component.ts
@@ -4,7 +4,7 @@ import { SalesTaxService } from './sales-tax.service';
import { TaxRateService } from './tax-rate.service';
@Component({
- selector: 'sales-tax',
+ selector: 'app-sales-tax',
template: `
Sales Tax Calculator
Amount:
diff --git a/aio/content/examples/architecture/src/index.html b/aio/content/examples/architecture/src/index.html
index 9aadf6e1091..93ea2e27dcc 100644
--- a/aio/content/examples/architecture/src/index.html
+++ b/aio/content/examples/architecture/src/index.html
@@ -1,26 +1,13 @@
-
+
Architecture of Angular
-
-
-
-
-
-
-
-
-
-
-
- Loading...
+
diff --git a/aio/content/examples/architecture/src/main.ts b/aio/content/examples/architecture/src/main.ts
index 6b6532d428a..0740658908d 100644
--- a/aio/content/examples/architecture/src/main.ts
+++ b/aio/content/examples/architecture/src/main.ts
@@ -1,5 +1,12 @@
// #docregion
+import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/aio/content/examples/attribute-directives/e2e-spec.ts b/aio/content/examples/attribute-directives/e2e/app.e2e-spec.ts
similarity index 100%
rename from aio/content/examples/attribute-directives/e2e-spec.ts
rename to aio/content/examples/attribute-directives/e2e/app.e2e-spec.ts
diff --git a/aio/content/examples/attribute-directives/src/app/app.component.1.html b/aio/content/examples/attribute-directives/src/app/app.component.1.html
index 9505bc9dffd..cb25e1dec7a 100644
--- a/aio/content/examples/attribute-directives/src/app/app.component.1.html
+++ b/aio/content/examples/attribute-directives/src/app/app.component.1.html
@@ -1,14 +1,14 @@
My First Attribute Directive
-Highlight me!
+Highlight me!
-Highlighted in yellow
-Highlighted in orange
+Highlighted in yellow
+Highlighted in orange
-Highlighted with parent component's color
+Highlighted with parent component's color
diff --git a/aio/content/examples/attribute-directives/src/app/app.component.1.ts b/aio/content/examples/attribute-directives/src/app/app.component.1.ts
index d9b98ef3fde..7924a2366ab 100644
--- a/aio/content/examples/attribute-directives/src/app/app.component.1.ts
+++ b/aio/content/examples/attribute-directives/src/app/app.component.1.ts
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
- selector: 'my-app',
+ selector: 'app-root',
templateUrl: './app.component.1.html'
})
// #docregion class
diff --git a/aio/content/examples/attribute-directives/src/app/app.component.html b/aio/content/examples/attribute-directives/src/app/app.component.html
index 3adb52bc1e1..c361f112871 100644
--- a/aio/content/examples/attribute-directives/src/app/app.component.html
+++ b/aio/content/examples/attribute-directives/src/app/app.component.html
@@ -8,11 +8,11 @@
Cyan
-Highlight me!
+Highlight me!
-
+
Highlight me too!
@@ -20,5 +20,5 @@
Mouse over the following lines to see fixed highlights
-Highlighted in yellow
-Highlighted in orange
+Highlighted in yellow
+Highlighted in orange
diff --git a/aio/content/examples/attribute-directives/src/app/app.component.ts b/aio/content/examples/attribute-directives/src/app/app.component.ts
index 693918d8d6d..01d0dd5b5f1 100644
--- a/aio/content/examples/attribute-directives/src/app/app.component.ts
+++ b/aio/content/examples/attribute-directives/src/app/app.component.ts
@@ -2,7 +2,7 @@
import { Component } from '@angular/core';
@Component({
- selector: 'my-app',
+ selector: 'app-root',
templateUrl: './app.component.html'
})
// #docregion class
diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.1.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.1.ts
index 4cacc0d22eb..bc9d1ac6e1f 100644
--- a/aio/content/examples/attribute-directives/src/app/highlight.directive.1.ts
+++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.1.ts
@@ -2,7 +2,7 @@
// #docregion
import { Directive, ElementRef, Input } from '@angular/core';
-@Directive({ selector: '[myHighlight]' })
+@Directive({ selector: '[appHighlight]' })
export class HighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'yellow';
diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts
index 6778e7e46c5..15765ca481f 100644
--- a/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts
+++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.2.ts
@@ -4,7 +4,7 @@
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({
- selector: '[myHighlight]'
+ selector: '[appHighlight]'
})
export class HighlightDirective {
// #docregion ctor
diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts
index bf76769c936..c0892fa3812 100644
--- a/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts
+++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.3.ts
@@ -3,13 +3,13 @@
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({
- selector: '[myHighlight]'
+ selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(private el: ElementRef) { }
- @Input('myHighlight') highlightColor: string;
+ @Input('appHighlight') highlightColor: string;
// #docregion mouse-enter
@HostListener('mouseenter') onMouseEnter() {
diff --git a/aio/content/examples/attribute-directives/src/app/highlight.directive.ts b/aio/content/examples/attribute-directives/src/app/highlight.directive.ts
index 2269cbbe39e..a5a1eb7d898 100644
--- a/aio/content/examples/attribute-directives/src/app/highlight.directive.ts
+++ b/aio/content/examples/attribute-directives/src/app/highlight.directive.ts
@@ -4,7 +4,7 @@ import { Directive, ElementRef, HostListener, Input } from '@angular/core';
// #enddocregion imports
@Directive({
- selector: '[myHighlight]'
+ selector: '[appHighlight]'
})
export class HighlightDirective {
@@ -15,7 +15,7 @@ export class HighlightDirective {
// #enddocregion defaultColor
// #docregion color
- @Input('myHighlight') highlightColor: string;
+ @Input('appHighlight') highlightColor: string;
// #enddocregion color
// #docregion mouse-enter
diff --git a/aio/content/examples/attribute-directives/src/index.html b/aio/content/examples/attribute-directives/src/index.html
index 97662437f00..12cabb63626 100644
--- a/aio/content/examples/attribute-directives/src/index.html
+++ b/aio/content/examples/attribute-directives/src/index.html
@@ -1,25 +1,13 @@
-
+
Attribute Directives
-
-
-
-
-
-
-
-
-
-
- loading...
+
diff --git a/aio/content/examples/attribute-directives/src/main.ts b/aio/content/examples/attribute-directives/src/main.ts
index 6b6532d428a..0740658908d 100644
--- a/aio/content/examples/attribute-directives/src/main.ts
+++ b/aio/content/examples/attribute-directives/src/main.ts
@@ -1,5 +1,12 @@
// #docregion
+import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/aio/content/examples/cli-quickstart/e2e-spec.ts b/aio/content/examples/cli-quickstart/e2e-spec.ts
deleted file mode 100644
index 3f0760b56e5..00000000000
--- a/aio/content/examples/cli-quickstart/e2e-spec.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'; // necessary for es6 output in node
-
-import { browser, element, by } from 'protractor';
-
-describe('cli-quickstart App', () => {
- beforeEach(() => {
- return browser.get('/');
- });
-
- it('should display message saying app works', () => {
- let pageTitle = element(by.css('app-root h1')).getText();
- expect(pageTitle).toEqual('Welcome to My First Angular App!!');
- });
-});
diff --git a/aio/content/examples/cli-quickstart/e2e/app.e2e-spec.ts b/aio/content/examples/cli-quickstart/e2e/app.e2e-spec.ts
index eea51018bd9..3f0760b56e5 100644
--- a/aio/content/examples/cli-quickstart/e2e/app.e2e-spec.ts
+++ b/aio/content/examples/cli-quickstart/e2e/app.e2e-spec.ts
@@ -1,14 +1,14 @@
-import { MyAppPage } from './app.po';
+'use strict'; // necessary for es6 output in node
-describe('my-app App', function() {
- let page: MyAppPage;
+import { browser, element, by } from 'protractor';
+describe('cli-quickstart App', () => {
beforeEach(() => {
- page = new MyAppPage();
+ return browser.get('/');
});
it('should display message saying app works', () => {
- page.navigateTo();
- expect(page.getParagraphText()).toEqual('Welcome to app!!');
+ let pageTitle = element(by.css('app-root h1')).getText();
+ expect(pageTitle).toEqual('Welcome to My First Angular App!!');
});
});
diff --git a/aio/content/examples/cli-quickstart/zipper.json b/aio/content/examples/cli-quickstart/zipper.json
index 70bf41659e4..7e4bda5d9f9 100644
--- a/aio/content/examples/cli-quickstart/zipper.json
+++ b/aio/content/examples/cli-quickstart/zipper.json
@@ -5,7 +5,5 @@
"!**/*.[0-9].*",
".angular-cli.json",
"protractor.conf.js"
- ],
- "removeSystemJsConfig": true,
- "type": "cli"
+ ]
}
diff --git a/aio/content/examples/component-interaction/e2e-spec.ts b/aio/content/examples/component-interaction/e2e/app.e2e-spec.ts
similarity index 84%
rename from aio/content/examples/component-interaction/e2e-spec.ts
rename to aio/content/examples/component-interaction/e2e/app.e2e-spec.ts
index d78e0784d9d..7637a6affc3 100644
--- a/aio/content/examples/component-interaction/e2e-spec.ts
+++ b/aio/content/examples/component-interaction/e2e/app.e2e-spec.ts
@@ -17,8 +17,8 @@ describe('Component Communication Cookbook Tests', function () {
let _masterName = 'Master';
it('should pass properties to children properly', function () {
- let parent = element.all(by.tagName('hero-parent')).get(0);
- let heroes = parent.all(by.tagName('hero-child'));
+ let parent = element.all(by.tagName('app-hero-parent')).get(0);
+ let heroes = parent.all(by.tagName('app-hero-child'));
for (let i = 0; i < _heroNames.length; i++) {
let childTitle = heroes.get(i).element(by.tagName('h3')).getText();
@@ -37,8 +37,8 @@ describe('Component Communication Cookbook Tests', function () {
it('should display trimmed, non-empty names', function () {
let _nonEmptyNameIndex = 0;
let _nonEmptyName = '"Mr. IQ"';
- let parent = element.all(by.tagName('name-parent')).get(0);
- let hero = parent.all(by.tagName('name-child')).get(_nonEmptyNameIndex);
+ let parent = element.all(by.tagName('app-name-parent')).get(0);
+ let hero = parent.all(by.tagName('app-name-child')).get(_nonEmptyNameIndex);
let displayName = hero.element(by.tagName('h3')).getText();
expect(displayName).toEqual(_nonEmptyName);
@@ -47,8 +47,8 @@ describe('Component Communication Cookbook Tests', function () {
it('should replace empty name with default name', function () {
let _emptyNameIndex = 1;
let _defaultName = '""';
- let parent = element.all(by.tagName('name-parent')).get(0);
- let hero = parent.all(by.tagName('name-child')).get(_emptyNameIndex);
+ let parent = element.all(by.tagName('app-name-parent')).get(0);
+ let hero = parent.all(by.tagName('app-name-child')).get(_emptyNameIndex);
let displayName = hero.element(by.tagName('h3')).getText();
expect(displayName).toEqual(_defaultName);
@@ -73,7 +73,7 @@ describe('Component Communication Cookbook Tests', function () {
});
it('should set expected values after clicking \'Minor\' twice', function () {
- let repoTag = element(by.tagName('version-parent'));
+ let repoTag = element(by.tagName('app-version-parent'));
let newMinorButton = repoTag.all(by.tagName('button')).get(0);
newMinorButton.click().then(function() {
@@ -91,7 +91,7 @@ describe('Component Communication Cookbook Tests', function () {
});
it('should set expected values after clicking \'Major\' once', function () {
- let repoTag = element(by.tagName('version-parent'));
+ let repoTag = element(by.tagName('app-version-parent'));
let newMajorButton = repoTag.all(by.tagName('button')).get(1);
newMajorButton.click().then(function() {
@@ -107,7 +107,7 @@ describe('Component Communication Cookbook Tests', function () {
});
function getActual() {
- let versionTag = element(by.tagName('version-child'));
+ let versionTag = element(by.tagName('app-version-child'));
let label = versionTag.element(by.tagName('h3')).getText();
let ul = versionTag.element((by.tagName('ul')));
let logs = ul.all(by.tagName('li'));
@@ -127,26 +127,26 @@ describe('Component Communication Cookbook Tests', function () {
// #docregion child-to-parent
// ...
it('should not emit the event initially', function () {
- let voteLabel = element(by.tagName('vote-taker'))
+ let voteLabel = element(by.tagName('app-vote-taker'))
.element(by.tagName('h3')).getText();
expect(voteLabel).toBe('Agree: 0, Disagree: 0');
});
it('should process Agree vote', function () {
- let agreeButton1 = element.all(by.tagName('my-voter')).get(0)
+ let agreeButton1 = element.all(by.tagName('app-voter')).get(0)
.all(by.tagName('button')).get(0);
agreeButton1.click().then(function() {
- let voteLabel = element(by.tagName('vote-taker'))
+ let voteLabel = element(by.tagName('app-vote-taker'))
.element(by.tagName('h3')).getText();
expect(voteLabel).toBe('Agree: 1, Disagree: 0');
});
});
it('should process Disagree vote', function () {
- let agreeButton1 = element.all(by.tagName('my-voter')).get(1)
+ let agreeButton1 = element.all(by.tagName('app-voter')).get(1)
.all(by.tagName('button')).get(1);
agreeButton1.click().then(function() {
- let voteLabel = element(by.tagName('vote-taker'))
+ let voteLabel = element(by.tagName('app-vote-taker'))
.element(by.tagName('h3')).getText();
expect(voteLabel).toBe('Agree: 1, Disagree: 1');
});
@@ -170,7 +170,7 @@ describe('Component Communication Cookbook Tests', function () {
// ...
it('timer and parent seconds should match', function () {
let parent = element(by.tagName(parentTag));
- let message = parent.element(by.tagName('countdown-timer')).getText();
+ let message = parent.element(by.tagName('app-countdown-timer')).getText();
browser.sleep(10); // give `seconds` a chance to catchup with `message`
let seconds = parent.element(by.className('seconds')).getText();
expect(message).toContain(seconds);
@@ -181,7 +181,7 @@ describe('Component Communication Cookbook Tests', function () {
let stopButton = parent.all(by.tagName('button')).get(1);
stopButton.click().then(function() {
- let message = parent.element(by.tagName('countdown-timer')).getText();
+ let message = parent.element(by.tagName('app-countdown-timer')).getText();
expect(message).toContain('Holding');
});
});
@@ -194,7 +194,7 @@ describe('Component Communication Cookbook Tests', function () {
// #docregion bidirectional-service
// ...
it('should announce a mission', function () {
- let missionControl = element(by.tagName('mission-control'));
+ let missionControl = element(by.tagName('app-mission-control'));
let announceButton = missionControl.all(by.tagName('button')).get(0);
announceButton.click().then(function () {
let history = missionControl.all(by.tagName('li'));
@@ -217,7 +217,7 @@ describe('Component Communication Cookbook Tests', function () {
function testConfirmMission(buttonIndex: number, expectedLogCount: number, astronaut: string) {
let _confirmedLog = ' confirmed the mission';
- let missionControl = element(by.tagName('mission-control'));
+ let missionControl = element(by.tagName('app-mission-control'));
let confirmButton = missionControl.all(by.tagName('button')).get(buttonIndex);
confirmButton.click().then(function () {
let history = missionControl.all(by.tagName('li'));
diff --git a/aio/content/examples/component-interaction/src/app/app.component.html b/aio/content/examples/component-interaction/src/app/app.component.html
index ef94020efbf..907e0181fa6 100644
--- a/aio/content/examples/component-interaction/src/app/app.component.html
+++ b/aio/content/examples/component-interaction/src/app/app.component.html
@@ -9,43 +9,43 @@
Parent and children communicate via a service ("Mission Control")
Back to Top
Back to Top
Back to Top
Back to Top
Back to Top
Back to Top
Back to Top
diff --git a/aio/content/examples/component-interaction/src/app/app.component.ts b/aio/content/examples/component-interaction/src/app/app.component.ts
index 7556beb1ff0..968036cb8c2 100644
--- a/aio/content/examples/component-interaction/src/app/app.component.ts
+++ b/aio/content/examples/component-interaction/src/app/app.component.ts
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
- selector: 'my-app',
+ selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent { }
diff --git a/aio/content/examples/component-interaction/src/app/astronaut.component.ts b/aio/content/examples/component-interaction/src/app/astronaut.component.ts
index bc24964f860..b12497fee46 100644
--- a/aio/content/examples/component-interaction/src/app/astronaut.component.ts
+++ b/aio/content/examples/component-interaction/src/app/astronaut.component.ts
@@ -5,7 +5,7 @@ import { MissionService } from './mission.service';
import { Subscription } from 'rxjs/Subscription';
@Component({
- selector: 'my-astronaut',
+ selector: 'app-astronaut',
template: `
{{astronaut}}: {{mission}}
diff --git a/aio/content/examples/component-interaction/src/app/countdown-parent.component.ts b/aio/content/examples/component-interaction/src/app/countdown-parent.component.ts
index 5bcf0645c9c..9f4e5bd4dfd 100644
--- a/aio/content/examples/component-interaction/src/app/countdown-parent.component.ts
+++ b/aio/content/examples/component-interaction/src/app/countdown-parent.component.ts
@@ -11,15 +11,15 @@ import { CountdownTimerComponent } from './countdown-timer.component';
//// Local variable, #timer, version
// #docregion lv
@Component({
- selector: 'countdown-parent-lv',
+ selector: 'app-countdown-parent-lv',
template: `
Countdown to Liftoff (via local variable)
Start
Stop
{{timer.seconds}}
-
+
`,
- styleUrls: ['demo.css']
+ styleUrls: ['../assets/demo.css']
})
export class CountdownLocalVarParentComponent { }
// #enddocregion lv
@@ -27,15 +27,15 @@ export class CountdownLocalVarParentComponent { }
//// View Child version
// #docregion vc
@Component({
- selector: 'countdown-parent-vc',
+ selector: 'app-countdown-parent-vc',
template: `
Countdown to Liftoff (via ViewChild)
Start
Stop
{{ seconds() }}
-
+
`,
- styleUrls: ['demo.css']
+ styleUrls: ['../assets/demo.css']
})
export class CountdownViewChildParentComponent implements AfterViewInit {
diff --git a/aio/content/examples/component-interaction/src/app/countdown-timer.component.ts b/aio/content/examples/component-interaction/src/app/countdown-timer.component.ts
index a9a1a2fa7ce..dcc88334d02 100644
--- a/aio/content/examples/component-interaction/src/app/countdown-timer.component.ts
+++ b/aio/content/examples/component-interaction/src/app/countdown-timer.component.ts
@@ -2,7 +2,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
@Component({
- selector: 'countdown-timer',
+ selector: 'app-countdown-timer',
template: '{{message}}
'
})
export class CountdownTimerComponent implements OnInit, OnDestroy {
diff --git a/aio/content/examples/component-interaction/src/app/hero-child.component.ts b/aio/content/examples/component-interaction/src/app/hero-child.component.ts
index 7447542a742..4a0b8d4229f 100644
--- a/aio/content/examples/component-interaction/src/app/hero-child.component.ts
+++ b/aio/content/examples/component-interaction/src/app/hero-child.component.ts
@@ -4,7 +4,7 @@ import { Component, Input } from '@angular/core';
import { Hero } from './hero';
@Component({
- selector: 'hero-child',
+ selector: 'app-hero-child',
template: `
{{hero.name}} says:
I, {{hero.name}}, am at your service, {{masterName}}.
diff --git a/aio/content/examples/component-interaction/src/app/hero-parent.component.ts b/aio/content/examples/component-interaction/src/app/hero-parent.component.ts
index 19ceda7bac0..949c649c82f 100644
--- a/aio/content/examples/component-interaction/src/app/hero-parent.component.ts
+++ b/aio/content/examples/component-interaction/src/app/hero-parent.component.ts
@@ -4,13 +4,13 @@ import { Component } from '@angular/core';
import { HEROES } from './hero';
@Component({
- selector: 'hero-parent',
+ selector: 'app-hero-parent',
template: `
{{master}} controls {{heroes.length}} heroes
-
-
+
`
})
export class HeroParentComponent {
diff --git a/aio/content/examples/component-interaction/src/app/missioncontrol.component.ts b/aio/content/examples/component-interaction/src/app/missioncontrol.component.ts
index a27e9b16b14..4c1f539b594 100644
--- a/aio/content/examples/component-interaction/src/app/missioncontrol.component.ts
+++ b/aio/content/examples/component-interaction/src/app/missioncontrol.component.ts
@@ -4,13 +4,13 @@ import { Component } from '@angular/core';
import { MissionService } from './mission.service';
@Component({
- selector: 'mission-control',
+ selector: 'app-mission-control',
template: `
Mission Control
Announce mission
-
-
+
History
{{event}}
diff --git a/aio/content/examples/component-interaction/src/app/name-child.component.ts b/aio/content/examples/component-interaction/src/app/name-child.component.ts
index bc6d3c6f595..8393e21ebdf 100644
--- a/aio/content/examples/component-interaction/src/app/name-child.component.ts
+++ b/aio/content/examples/component-interaction/src/app/name-child.component.ts
@@ -2,7 +2,7 @@
import { Component, Input } from '@angular/core';
@Component({
- selector: 'name-child',
+ selector: 'app-name-child',
template: '"{{name}}" '
})
export class NameChildComponent {
diff --git a/aio/content/examples/component-interaction/src/app/name-parent.component.ts b/aio/content/examples/component-interaction/src/app/name-parent.component.ts
index 99753303aa6..2c8c23b7812 100644
--- a/aio/content/examples/component-interaction/src/app/name-parent.component.ts
+++ b/aio/content/examples/component-interaction/src/app/name-parent.component.ts
@@ -2,10 +2,10 @@
import { Component } from '@angular/core';
@Component({
- selector: 'name-parent',
+ selector: 'app-name-parent',
template: `
Master controls {{names.length}} names
-
+
`
})
export class NameParentComponent {
diff --git a/aio/content/examples/component-interaction/src/app/version-child.component.ts b/aio/content/examples/component-interaction/src/app/version-child.component.ts
index 89d365cf9f5..1f3da880f4d 100644
--- a/aio/content/examples/component-interaction/src/app/version-child.component.ts
+++ b/aio/content/examples/component-interaction/src/app/version-child.component.ts
@@ -3,7 +3,7 @@
import { Component, Input, OnChanges, SimpleChange } from '@angular/core';
@Component({
- selector: 'version-child',
+ selector: 'app-version-child',
template: `
Version {{major}}.{{minor}}
Change log:
diff --git a/aio/content/examples/component-interaction/src/app/version-parent.component.ts b/aio/content/examples/component-interaction/src/app/version-parent.component.ts
index 5a8d904c727..0e9476b3c6d 100644
--- a/aio/content/examples/component-interaction/src/app/version-parent.component.ts
+++ b/aio/content/examples/component-interaction/src/app/version-parent.component.ts
@@ -2,12 +2,12 @@
import { Component } from '@angular/core';
@Component({
- selector: 'version-parent',
+ selector: 'app-version-parent',
template: `
Source code version
New minor version
New major version
-
+
`
})
export class VersionParentComponent {
diff --git a/aio/content/examples/component-interaction/src/app/voter.component.ts b/aio/content/examples/component-interaction/src/app/voter.component.ts
index c0cb23abc05..9583e744663 100644
--- a/aio/content/examples/component-interaction/src/app/voter.component.ts
+++ b/aio/content/examples/component-interaction/src/app/voter.component.ts
@@ -2,7 +2,7 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
- selector: 'my-voter',
+ selector: 'app-voter',
template: `
{{name}}
Agree
diff --git a/aio/content/examples/component-interaction/src/app/votetaker.component.ts b/aio/content/examples/component-interaction/src/app/votetaker.component.ts
index 87f06161f5c..564cb93261a 100644
--- a/aio/content/examples/component-interaction/src/app/votetaker.component.ts
+++ b/aio/content/examples/component-interaction/src/app/votetaker.component.ts
@@ -2,14 +2,14 @@
import { Component } from '@angular/core';
@Component({
- selector: 'vote-taker',
+ selector: 'app-vote-taker',
template: `
Should mankind colonize the Universe?
Agree: {{agreed}}, Disagree: {{disagreed}}
-
-
+
`
})
export class VoteTakerComponent {
diff --git a/aio/content/examples/component-interaction/src/demo.css b/aio/content/examples/component-interaction/src/assets/demo.css
similarity index 100%
rename from aio/content/examples/component-interaction/src/demo.css
rename to aio/content/examples/component-interaction/src/assets/demo.css
diff --git a/aio/content/examples/component-interaction/src/index.html b/aio/content/examples/component-interaction/src/index.html
index 64c8a3430fa..cb5f519b8c6 100644
--- a/aio/content/examples/component-interaction/src/index.html
+++ b/aio/content/examples/component-interaction/src/index.html
@@ -1,5 +1,5 @@
-
+
Passing information from parent to child
@@ -7,23 +7,10 @@
-
-
-
-
-
-
-
-
-
-
-
- loading...
+
diff --git a/aio/content/examples/component-interaction/src/main.ts b/aio/content/examples/component-interaction/src/main.ts
index 311c44b76de..a9ca1caf8ce 100644
--- a/aio/content/examples/component-interaction/src/main.ts
+++ b/aio/content/examples/component-interaction/src/main.ts
@@ -1,5 +1,11 @@
+import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+ enableProdMode();
+}
platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/aio/content/examples/component-styles/e2e-spec.ts b/aio/content/examples/component-styles/e2e/app.e2e-spec.ts
similarity index 78%
rename from aio/content/examples/component-styles/e2e-spec.ts
rename to aio/content/examples/component-styles/e2e/app.e2e-spec.ts
index 32bd30832c7..943d5922716 100644
--- a/aio/content/examples/component-styles/e2e-spec.ts
+++ b/aio/content/examples/component-styles/e2e/app.e2e-spec.ts
@@ -9,7 +9,7 @@ describe('Component Style Tests', function () {
});
it('scopes component styles to component view', function() {
- let componentH1 = element(by.css('hero-app > h1'));
+ let componentH1 = element(by.css('app-root > h1'));
let externalH1 = element(by.css('body > h1'));
expect(componentH1.getCssValue('fontWeight')).toEqual('normal');
@@ -18,47 +18,47 @@ describe('Component Style Tests', function () {
it('allows styling :host element', function() {
- let host = element(by.css('hero-details'));
+ let host = element(by.css('app-hero-details'));
expect(host.getCssValue('borderWidth')).toEqual('1px');
});
it('supports :host() in function form', function() {
- let host = element(by.css('hero-details'));
+ let host = element(by.css('app-hero-details'));
host.element(by.buttonText('Activate')).click();
expect(host.getCssValue('borderWidth')).toEqual('3px');
});
it('allows conditional :host-context() styling', function() {
- let h2 = element(by.css('hero-details h2'));
+ let h2 = element(by.css('app-hero-details h2'));
expect(h2.getCssValue('backgroundColor')).toEqual('rgba(238, 238, 255, 1)'); // #eeeeff
});
it('styles both view and content children with /deep/', function() {
- let viewH3 = element(by.css('hero-team h3'));
- let contentH3 = element(by.css('hero-controls h3'));
+ let viewH3 = element(by.css('app-hero-team h3'));
+ let contentH3 = element(by.css('app-hero-controls h3'));
expect(viewH3.getCssValue('fontStyle')).toEqual('italic');
expect(contentH3.getCssValue('fontStyle')).toEqual('italic');
});
it('includes styles loaded with CSS @import', function() {
- let host = element(by.css('hero-details'));
+ let host = element(by.css('app-hero-details'));
expect(host.getCssValue('padding')).toEqual('10px');
});
it('processes template inline styles', function() {
- let button = element(by.css('hero-controls button'));
+ let button = element(by.css('app-hero-controls button'));
let externalButton = element(by.css('body > button'));
expect(button.getCssValue('backgroundColor')).toEqual('rgba(255, 255, 255, 1)'); // #ffffff
expect(externalButton.getCssValue('backgroundColor')).not.toEqual('rgba(255, 255, 255, 1)');
});
it('processes template s', function() {
- let li = element(by.css('hero-team li:first-child'));
+ let li = element(by.css('app-hero-team li:first-child'));
let externalLi = element(by.css('body > ul li'));
expect(li.getCssValue('listStyleType')).toEqual('square');
diff --git a/aio/content/examples/component-styles/src/app/hero-app-main.component.ts b/aio/content/examples/component-styles/src/app/hero-app-main.component.ts
index aebb1f729e6..efecea0b42c 100644
--- a/aio/content/examples/component-styles/src/app/hero-app-main.component.ts
+++ b/aio/content/examples/component-styles/src/app/hero-app-main.component.ts
@@ -3,12 +3,12 @@ import { Component, Input } from '@angular/core';
import { Hero } from './hero';
@Component({
- selector: 'hero-app-main',
+ selector: 'app-hero-main',
template: `
-
-
-
-
+
+
+
+
`
})
export class HeroAppMainComponent {
diff --git a/aio/content/examples/component-styles/src/app/hero-app.component.ts b/aio/content/examples/component-styles/src/app/hero-app.component.ts
index 5f1923e6f35..fdb08b988f0 100644
--- a/aio/content/examples/component-styles/src/app/hero-app.component.ts
+++ b/aio/content/examples/component-styles/src/app/hero-app.component.ts
@@ -3,10 +3,10 @@ import { Hero } from './hero';
// #docregion
@Component({
- selector: 'hero-app',
+ selector: 'app-root',
template: `
Tour of Heroes
- `,
+ `,
styles: ['h1 { font-weight: normal; }']
})
export class HeroAppComponent {
diff --git a/aio/content/examples/component-styles/src/app/hero-controls.component.ts b/aio/content/examples/component-styles/src/app/hero-controls.component.ts
index 5d293596d2a..2b6ad84aa0e 100644
--- a/aio/content/examples/component-styles/src/app/hero-controls.component.ts
+++ b/aio/content/examples/component-styles/src/app/hero-controls.component.ts
@@ -3,7 +3,7 @@ import { Hero } from './hero';
// #docregion inlinestyles
@Component({
- selector: 'hero-controls',
+ selector: 'app-hero-controls',
template: `