Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 231011

The call to onClick with ion-fab-button does not work

$
0
0

.ts code

 buttonDetials: any;
  constructor(private api: ApiService) {
    this.buttonDetials = [
      { label: "Add", icon: "add", color: "warning", onclick: function() {console.log('Hello Add')}},
      { label: "Close", icon: "close", color: "warning", onclick: function() {console.log('Hello Close')} },
      { label: "Approve", icon: "checkmark", color: "warning", onclick: function() {console.log('Hello Approve')} }
    ];
  }

  func(details) {
   details.onclick();
  }

.html code

<ul>
  <li *ngFor="let details of buttonDetials">
    <ion-fab right bottom>
      <ion-fab-button color='details.color' (click)="func(details)">
        <ion-icon name="details.icon"></ion-icon>
      </ion-fab-button>
    </ion-fab>
  </li> 
</ul>

console
image


Viewing all articles
Browse latest Browse all 231011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>