I can retrieve the value in the view but not in the construtor. My component is in an ngFor and I want to edit each item independently. That's why I create a child component
<li style="list-style-type: none;" *ngFor="let event of item.Events">
... <child-component [demo]="event"></child-component>
In the child component : I can display the result of demo in the view but I can not retrieve it in the constructor to be able to manipulate it
@Component({
selector: 'child-component',
queries: {
content: new ViewChild('content')
},
templateUrl: 'build/pages/dashboard/timeline/timeline-feeling/index.html',
...
inputs: ['demo'],
...
})
export class TimelinFeeling{
static get parameters () {
return [];
}
constructor () {
this.demo = demo;
console.log(this.demo); //return undefined
}