material icon indicating copy to clipboard operation
material copied to clipboard

md-chips and ng-change

Open xeor opened this issue 11 years ago • 16 comments

It looks like md-chips currently does not support ng-change, and it only have an attribute (md-on-append), to do something when a new item is added.

Either, md-chips needs support for ng-change, or it needs an md-on-delete attribute. Now, it looks like the best way is to use scope.$watchCollection on the md-chip ng-model attribute to trigger what you want to do.

Old issue that kinda asks the same question: https://github.com/angular/material/issues/2259 Forumpost about the same: https://groups.google.com/forum/#!searchin/ngmaterial/ng-change/ngmaterial/AHB3LEMgudI/6TARclcvjYMJ

xeor avatar Jul 04 '15 12:07 xeor

+1

chinnichaitanya avatar Jul 04 '15 12:07 chinnichaitanya

+1

maku avatar Jul 04 '15 15:07 maku

+10086

victoryancn avatar Jul 05 '15 17:07 victoryancn

+1, would make our lives a lot easier

coty-crg avatar Jul 21 '15 19:07 coty-crg

+1

advancedits avatar Jul 31 '15 01:07 advancedits

duplicate of #3857

typotter avatar Aug 10 '15 16:08 typotter

+1

vishal41190 avatar Oct 15 '15 22:10 vishal41190

+1

erinjanae avatar Nov 10 '15 23:11 erinjanae

+1

Liam-Williams avatar Nov 17 '15 03:11 Liam-Williams

+1

omarjcamo avatar Aug 02 '16 16:08 omarjcamo

+1

peter-imrich avatar Aug 09 '16 09:08 peter-imrich

+1

vrgakos avatar Aug 20 '16 16:08 vrgakos

+1

Volodymyr-Mishyn avatar Sep 19 '16 08:09 Volodymyr-Mishyn

+1

ycy233 avatar Feb 22 '17 09:02 ycy233

md-on-add and md-on-remove work for me:

<md-chips ng-model="currentItem.tags" md-on-add="updateTags()" md-on-remove="updateTags()">
</md-chips>

bolau avatar Nov 27 '17 00:11 bolau

@bolau That actually worked! :+1: Thank you! :1st_place_medal:

ibnYusrat avatar Dec 20 '17 06:12 ibnYusrat