Here is the logic: On enter, execute the following if statement
if (!elementB.isOpen){
elementB.open()
else {
elementC.open()
elementC.focus()
elementB.close()
}
I want to use the ? conditional operator and add it after (keyup.enter):
<mat-form-field (keyup.enter)="!elementB.isOpen ? elementB.open() : elementC.open();elementC.focus();elementB.close()">
However the code above gave me an error. It seems like I cannot execute multiple lines of code with conditional operator( ? : ).
Can anyone help me with this? Thanks!
**,**. But it's not really recommended. You should keep more of your logic in TypeScript. It's more managable and unit-testable that way.