
committed by
Igor Minar

parent
344a5ca545
commit
9bbf009dff
@ -6,7 +6,7 @@ import { LoggerService } from './logger.service';
|
||||
|
||||
//////////////////
|
||||
@Component({
|
||||
selector: 'my-child',
|
||||
selector: 'app-child',
|
||||
template: '<input [(ngModel)]="hero">'
|
||||
})
|
||||
export class ChildComponent {
|
||||
@ -86,7 +86,7 @@ export class AfterContentComponent implements AfterContentChecked, AfterContentI
|
||||
<div *ngIf="show">` +
|
||||
// #docregion parent-template
|
||||
`<after-content>
|
||||
<my-child></my-child>
|
||||
<app-child></app-child>
|
||||
</after-content>`
|
||||
// #enddocregion parent-template
|
||||
+ `</div>
|
||||
|
@ -7,7 +7,7 @@ import { LoggerService } from './logger.service';
|
||||
//////////////////
|
||||
// #docregion child-view
|
||||
@Component({
|
||||
selector: 'my-child-view',
|
||||
selector: 'app-child-view',
|
||||
template: '<input [(ngModel)]="hero">'
|
||||
})
|
||||
export class ChildViewComponent {
|
||||
@ -21,7 +21,7 @@ export class ChildViewComponent {
|
||||
// #docregion template
|
||||
template: `
|
||||
<div>-- child view begins --</div>
|
||||
<my-child-view></my-child-view>
|
||||
<app-child-view></app-child-view>
|
||||
<div>-- child view ends --</div>`
|
||||
// #enddocregion template
|
||||
+ `
|
||||
|
@ -1,7 +1,7 @@
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html'
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
import { LoggerService } from './logger.service';
|
||||
|
||||
@Component({
|
||||
selector: 'my-counter',
|
||||
selector: 'app-counter',
|
||||
template: `
|
||||
<div class="counter">
|
||||
Counter = {{counter}}
|
||||
@ -49,7 +49,7 @@ export class MyCounterComponent implements OnChanges {
|
||||
<button (click)="updateCounter()">Update counter</button>
|
||||
<button (click)="reset()">Reset Counter</button>
|
||||
|
||||
<my-counter [counter]="value"></my-counter>
|
||||
<app-counter [counter]="value"></app-counter>
|
||||
|
||||
<h4>-- Spy Lifecycle Hook Log --</h4>
|
||||
<div *ngFor="let msg of spyLog">{{msg}}</div>
|
||||
|
@ -1,28 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- #docregion -->
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Angular Lifecycle Hooks</title>
|
||||
<base href="/">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<link rel="stylesheet" href="sample.css">
|
||||
|
||||
<!-- Polyfills -->
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
|
||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
|
||||
<script src="systemjs.config.js"></script>
|
||||
<script>
|
||||
System.import('main.js').catch(function(err){ console.error(err); });
|
||||
</script>
|
||||
<link rel="stylesheet" href="assets/sample.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<my-app>Loading...</my-app>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user