Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 9a1f9a0

Browse files
authored
fix(oui-chips): fix item removal (#279)
1 parent a1362d4 commit 9a1f9a0

File tree

3 files changed

+1167
-4
lines changed

3 files changed

+1167
-4
lines changed

packages/oui-chips/src/chips.controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addBooleanParameter } from "@ovh-ui/common/component-utils";
1+
import { addBooleanParameter, addDefaultParameter } from "@ovh-ui/common/component-utils";
22

33
export default class {
44
constructor ($attrs, $element, $timeout) {
@@ -12,8 +12,7 @@ export default class {
1212
$onInit () {
1313
addBooleanParameter(this, "closable");
1414
addBooleanParameter(this, "stacked");
15-
16-
this.items = this.items ? angular.copy(this.items) : [];
15+
addDefaultParameter(this, "item", []);
1716
}
1817

1918
$postLink () {

packages/oui-chips/src/chips.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<span class="oui-chip"
2-
ng-repeat="item in $ctrl.items track by $index"
2+
ng-repeat="item in $ctrl.items"
33
ng-class="::{
44
'oui-chip_closable': !!$ctrl.closable,
55
'oui-chip_full-width': !!$ctrl.stacked

0 commit comments

Comments
 (0)