×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nilesh Yadav
Added: Jul 20, 2017 10:59 AM
Views: 4
Tags: no tags
  1. in parent constructor
  2. -----------------------------------
  3. <user-profile [user]="currentUser"></user-profile>
  4.  
  5.  
  6. in child constructor.
  7. --------------------------------
  8. import { Component, Input } from '@angular/core';
  9.  
  10. @Component({
  11.   selector: 'user-profile',
  12.   template: '<div>{{user.name}}</div>'
  13. })
  14. export class UserProfile {
  15.   @Input() user;
  16.   constructor() {}
  17. }