Select All option for selecting all the values in md-option with in md-select. I am populating md-option by using ngFor and i am using formControl. I can see the checkboxes for all the md-option values. But I am not able to check all the checkboxes from typescript(.ts) file. How do put select all option? I am trying control.setValue(arrayvalues); But it doesn't check the checkboxes.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I wrote [compareWith] = compareById(obj1, obj2) attribute for md-select in my HTML page and in the .ts file write the below method {compareById(obj1, obj2){ return obj1 = obj2.code}
}. It works for me.
标签:
angular4-forms