I'm working with the following code snippet:
handleSubmit() {
let search = new ProductSearch();
search = this.profileForm.value;
console.log(search);
console.log(search.code);
}
When I run the console.log(search) line, it outputs:
{code: "123456"}
But when I run the console.log(search.code) line, it gives me:
undefined
Below is the definition of the ProductSearch object:
export class ProductSearch {
code: string;
}