Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

perent to child data pass in angular

//app.html:
<h1>this is perent component</h1>
<app-child [items]="employee"></app-child>
//app.component.ts:
 employee = {
    id: 1,
    name: 'chintan',
    address: 'junagadh',
  };
//child.component.ts:
@Input() items: any;
//child.html:
<h2>{{ items.id }}</h2>
<h2>{{ items.name }}</h2>
<h2>{{ items.address }}</h2>
Source by angular.io #
 
PREVIOUS NEXT
Tagged: #perent #child #data #pass #angular
ADD COMMENT
Topic
Name
8+8 =