componentWithContentOrNot.component.ts 545B

123456789101112131415161718192021
  1. import { Component, OnInit, ElementRef, ViewChild, ChangeDetectorRef } from '@angular/core';
  2. @Component({
  3. selector: 'app-componentWithContentOrNot',
  4. templateUrl: './componentWithContentOrNot.component.html',
  5. styleUrls: ['./componentWithContentOrNot.component.css']
  6. })
  7. export class ComponentWithContentOrNotComponent implements OnInit {
  8. // @ViewChild('content') content: ElementRef;
  9. constructor(
  10. private changeDetector: ChangeDetectorRef
  11. ) {}
  12. ngOnInit() {
  13. }
  14. hasChildChange(event) {
  15. this.changeDetector.detectChanges()
  16. }
  17. }