Hi guys , I hoping that someone can help me to understand the following syntax, or provide a link for reading material
I have this piece of code: (for example)
icon: !this.platform.is('ios') ? 'trash':null
OR
icon: mode !== 'ios' ? 'mail' : null
What does the “question mark” indicate here ?? and also meaning of ‘trash’: null … I know trash is the name of the icon , but the null part I am confused what it means !
In your piece of code ? is used for Ternary operator. In short for checking a condition and apply particular icon name as per the condition satisfied.
In your case maybe, the platform you may checking is if not iOS then apply class type for icon is null.
Maybe for above case programmer don’t want to apply CSS class or icon name for it.
And apply CSS class or icon name -> trash or mail if the platform is other than iOS.