angular - how to perform multiple buttons event handling onclick in listview -


i have 3 buttons in listview. need perform multiple button click trigger same method checkinstall. dont know how do. have added relevant code:

html file:

 <listview [items]="allappslist" class="list-group">     .......     .......    <stacklayout row="0" col="2">        <button  text= "install" (tap) ="checkinstall($event, myindex)" > </button>          <button text= "open" (tap) ="checkinstall($event1, myindex)" > </button>          <button text= "remove"(tap) ="checkinstall($event2, myindex)" > </button>       </stacklayout>  </listview>   

ts file:

checkinstall(args: eventdata, index : number) : void {  } 

for performing first button, checkinstall method working fine.but dont know how button id second , third button trigger separately checkinstall handle functionalities hide , show buttons.

$event angular key word, has output emitted value, can not change it

<button  text="install" (tap)="checkinstall($event,1,  myindex)"> </button>    <button text="open" (tap)="checkinstall($event, 2, myindex)" > </button>    <button text="remove"(tap)="checkinstall($event, 3, myindex)" > </button>  

you can send parameter method

checkinstall(args: eventdata, buttonindex: number, index : number) : void {  } 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -