简体   繁体   中英

why child component not showing console.log Outputs?

My child component showing its html Output fine but its showing console.log output in console and console.log working fine everywhere else in the project .And showing no error about this component in console

import { Component, OnInit, Input } from '@angular/core';

console.log('Mian is here')

@Component({
  selector: 'app-media-input',
  templateUrl: './media-input.component.html',
  styleUrls: ['./media-input.component.scss']
})

export class MediaInputComponent implements OnInit {
  Gallery='hello'

  @Input('media') media
  constructor() { 
    console.log('okok', this.media);
  }

  ngOnInit() {
    console.log('okomianas');
  }
}

通常的语法应该是

  @Input() media: yourType;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM