variable type validation in typescript not working

Viewed 201

I am new to typescript, i wrote code like below

export class RmdRequest {
    public amount: string;
    public age: number;
}

in my form i have like

in my component i have like below

 onSubmit(formValues:RmdRequest){ }

formValues is a object like below

{amount: 20, age: "Super Hot"}

If you see amount i have declared as string but passing as int. I was expecting this to throw out error of some sort. Am i doing something wrong for validation?

1 Answers
Related