I am new in angular4
I have an Registration process which contains multiple steps, So I am just hide/showing
my steps of the basis of some conditions.
So, Registration process contains parent and child component("sidebar" that show the value that user filled in last step).
I am passing a array from parent to child. And in each step I am updating my array with some values. When I'm printing my array in child HTML its working fine but when I trying to console the same array in child compenent.ts its showing nothing. I have to do some calculation like in my arary I have date of birth so I want to calculate the actual age of user and show the same on sidebar.
This is my array: MyArray This is how I am passing my array
Parent.html
<app child [MyArray]="MyArray"></app child>
ChildComponent.ts
import { Component, OnInit,Output,Input } from '@angular/core';
export class SidebarComponent implements OnInit {
@Input() MyArray: string;
ngOnInit() {
console.log(this.MyArray,'ssss');
}
}
If I use MyArray.email in my child.html then Its showing the value fine.
Anyone having any Idea What I am doing wrong here