Guest User

Untitled

a guest
Jan 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
  2.  
  3. @Component({
  4. selector: 'app-filho',
  5. templateUrl: './filho.component.html',
  6. styleUrls: ['./filho.component.scss']
  7. })
  8. export class FilhoComponent implements OnInit {
  9.  
  10. @Input() recebeFamilia;
  11. @Output() respostaFamilia = new EventEmitter();
  12.  
  13. constructor() { }
  14.  
  15. ngOnInit() {
  16. console.log(this.recebeFamilia);
  17. console.log('Objeto familia recebido do component pai via Input: ', this.recebeFamilia);
  18. }
  19.  
  20. feedback() {
  21. console.log('Resposta para o component pai', this.respostaFamilia.emit({"nome": "Raphella", "SobreNome": "Souza"}));
  22. }
  23.  
  24. }
Add Comment
Please, Sign In to add comment