How to binding a attribute

Takt this example

<ion-row responsive-sm>
   ......
</ion-row>

I want to bind the Attribute “responsive-sm” to property of the class:

class {
   Response = true

   changeModel(){
      this.Respone = !this.Respone;
   }
}

With that code not working.

<ion-row [attr.responsive-sm]="Response">
    ......
</ion-row>

I got it

[attr.responsive-sm]="Response ? '' : null"

2 Likes

works in ionic 4 too:grinning: