New to Angular so be nice...
I have a component that get a date/string value from a parent component:
export class myComponent implements OnInit {
    @Input() myDate: string;
    constructor(){}
    ngOnInit(){}
}
The problem I have is that I want to use split() method on the @Input myDate string so that I can use the parts (array indexes assigned to vars) in the view individually.
I tried following the Angular guide and ended up with this in my class:
private _myDate;
@Input()
set myDate(myDate: string){
    this._myDate = (myDate && myDate.split(' '));
}
get myDate(): string { return this._myDate };
but that returns undefined cannot and I don't know if the code I need to write goes in the class or in the constructor (because I see conflicting info all over the web).
Variation on above returns "Property split does not exist on type 'String[]'" which akes sense, but I can't seem to find out how to avoid either that error or in the first code sample, cannot convert type string to array:
private _myDate = [];
@Input()
set myDate(myDate: Array<String>){
    this._myDate = (myDate && myDate.split(' '));
}
get myDate(): Array<String> { return this._myDate };
So, how do I do work on the @Input myDate value and where do I do it?


myDateif it's null/undefined/empty, otherwise it'll return the result ofsplit.