setvalue - Angular 2: How to set value on multiple select in template? -
i want set value(set 0) of select button click event. event me clear count.
i have tried use [(ngmodel)] fix it, it'll sync value... don't want sync select value. need independent each select.
this first question. if has mistake, please let me know! thank you!
[template]
<div class="container"> <div id="gallery row clearfix"> <h2>volvo</h2> <div *ngfor="let item of carinfo" class="gallery-item"> <span *ngfor="let favs of item.favorite" class="glyphicon glyphicon-thumbs-up" style="color:blue"></span> <h3 class="carmodel" #model>{{item.model}}</h3> <img src={{item.src}}/> <h3 class="carprice" #price>{{item.price}}</h3> <p>count:</p> <select class="form-control" #t (change)="addtocart(model.innertext,t.value)"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> </select> </div> </div> </div> <button type="button" (click)="checkout()" class="btn btn-primary btn-lg btn-block">express checkout</button> <button type="button" (click)="clear()" class="btn btn-default btn-lg btn-block">clear</button>
add value 0.
<select class="form-control" #t > <option value="0">0</option> <option>1</option> <option>2</option> <option>3</option> </select>
your button
<button type="button" (click)="t.value=0" class="btn btn-default btn-lg btn-block">clear</button>
example
<video #movieplayer ...> <button (click)="movieplayer.play()"> </video>
Comments
Post a Comment