有人可以告诉我如何使用md-contact-chips
将数组推送到所有选定的项目。我尝试了md-on-select="getChipInfo($chip)" md-on-remove="removeChip($chip)"
但它不适合我。
答案 0 :(得分:0)
见:
https://angular-material.firebaseapp.com/1.0.0/api/directive/mdContactChips/ http://flowersinthesand.github.io/material/#/demo/material.components.chips/
使用属性ng-model =“myProperty”并在控制器中使用此代码:
$scope.myProperty = new Array({value: "A", id: 1}, {value: "B", id: 2});
$scope.$watch("myProperty ", function (newValue, oldValue) {
// my code on change
});