|
|
@ -1,28 +1,8 @@ |
|
|
|
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
|
|
|
import { FontSizeComponent } from './font-size/font-size.component'; |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'my-app', |
|
|
|
templateUrl: './app.component.html', |
|
|
|
styleUrls: ['./app.component.css'], |
|
|
|
}) |
|
|
|
export class AppComponent implements OnInit, AfterViewInit { |
|
|
|
@ViewChild(FontSizeComponent) size!: FontSizeComponent; |
|
|
|
@ViewChild(FontSizeComponent, { static: true }) |
|
|
|
staticSize!: FontSizeComponent; |
|
|
|
|
|
|
|
display = true; |
|
|
|
|
|
|
|
fontSize = 12; |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
console.log('AppComponent - ngOnInit - size', this.size); |
|
|
|
console.log('AppComponent - ngOnInit - staticSize', this.staticSize); |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
console.log('AppComponent - ngAfterViewInit - size', this.size); |
|
|
|
console.log('AppComponent - ngAfterViewInit - staticSize', this.staticSize); |
|
|
|
} |
|
|
|
} |
|
|
|
export class AppComponent {} |