I searched Google and looked through the Angular documentation, but couldn't find an explanation for what I'm encountering.
Can anyone clarify what the "as" keyword means? And can you point out any mistakes in my code below?
I have component A being used in component B, where a variable is declared in B with 'as' A. I am trying to access a function from A, but I'm getting an error because the function doesn't seem to exist.
A.component.ts;
...
getValue ():Array<string> {
return this.filter( elm => elm.length > 5 );
}
...
B.component.ts;
...
type C = A;
...
public coolArr: C;
printArr(param: any):void{
coolArr = param as A;
console.log(coolArr.getValue);
}
...
I'm unsure of where I went wrong in my implementation.