Skip to content

Commit a707759

Browse files
authored
Merge pull request #5999 from IgniteUI/thristodorova/fix-5998
docs(chip): remove duplicated dragging section
2 parents 82d1d22 + caf4aaf commit a707759

File tree

2 files changed

+70
-71
lines changed

2 files changed

+70
-71
lines changed

en/components/chip.md

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ _keywords: Angular Chip, Angular Chip Component, Angular Chip Area, Angular Chip
66

77
# Angular Chip Component Overview
88

9-
<p class="highlight">[The Angular Chip component]({environment:angularApiUrl}/classes/igxchipcomponent.html) is a visual element that displays information in an oval container. The component has various properties - it can be templated, deleted, and selected. Multiple chips can be reordered and visually connected to each other, using the chip area as a container.</p>
9+
<p class="highlight">The Angular Chip component is a visual element that displays information in an oval container. The component has various properties - it can be templated, deleted, and selected. Multiple chips can be reordered and visually connected to each other, using the chip area as a container.</p>
1010

1111
## Angular Chip Example
1212

13-
1413
<code-view style="height: 100px; padding-top: 10px"
1514
data-demos-base-url="{environment:demosBaseUrl}"
1615
iframe-src="{environment:demosBaseUrl}/data-display/chip-simple" alt="Angular Chip Example">
@@ -124,82 +123,17 @@ public chipRemoved(event: IBaseChipEventArgs) {
124123

125124
### Dragging
126125

127-
Dragging can be enabled by setting the [`draggable`]({environment:angularApiUrl}/classes/igxchipcomponent.html#removable) input to `true`. When enabled, you can click and drag the chip around.
126+
Dragging can be enabled by setting the [`draggable`]({environment:angularApiUrl}/classes/igxchipcomponent.html#draggable) input to `true`. When enabled, you can click and drag the chip around.
128127

129128
```html
130129
<igx-chip *ngFor="let chip of chipList" [id]="chip.id" [draggable]="true">
131-
<igx-icon igxPrefix>{{chip.icon}}</igx-icon>
132-
{chip.text}}
133-
</igx-chip>
134-
```
135-
136-
>[!NOTE]
137-
>To reorder the chips you need to handle the event using the [`IgxChipsAreaComponent`]({environment:angularApiUrl}/classes/igxchipsareacomponent.html).
138-
139-
<div class="divider"></div>
140-
141-
**To create the demo sample, we will use the features above:**
142-
143-
```html
144-
<igx-chip
145-
*ngFor="let chip of chipList"
146-
[id]="chip.id"
147-
[selectable]="true"
148-
[removable]="true"
149-
(remove)="chipRemoved($event)"
150-
>
151130
<igx-icon igxPrefix>{{chip.icon}}</igx-icon>
152131
{{chip.text}}
153132
</igx-chip>
154133
```
155134

156-
Then, we need to add the `chipList` and the function, that handles the [`remove`]({environment:angularApiUrl}/classes/igxchipcomponent.html#remove) event:
157-
158-
```ts
159-
import { IBaseChipEventArgs } from 'igniteui-angular';
160-
// import { IBaseChipEventArgs } from '@infragistics/igniteui-angular'; for licensed package
161-
...
162-
public chipList = [
163-
{
164-
text: 'Country',
165-
id: '1',
166-
icon: 'place'
167-
},
168-
{
169-
text: 'City',
170-
id: '2',
171-
icon: 'location_city'
172-
},
173-
{
174-
text: 'Town',
175-
id: '3',
176-
icon: 'store'
177-
},
178-
{
179-
text: 'First Name',
180-
id: '4',
181-
icon: 'person_pin'
182-
}
183-
];
184-
185-
private changeDetectionRef: any;
186-
187-
public chipRemoved(event: IBaseChipEventArgs) {
188-
this.chipList = this.chipList.filter((item) => {
189-
return item.id !== event.owner.id;
190-
});
191-
this.changeDetectionRef.detectChanges();
192-
}
193-
```
194-
195-
If everything went well, you should see this in your browser:
196-
197-
198-
<code-view style="height: 100px; padding-top: 10px"
199-
data-demos-base-url="{environment:demosBaseUrl}"
200-
iframe-src="{environment:demosBaseUrl}/data-display/chip-simple" >
201-
</code-view>
202-
135+
>[!NOTE]
136+
>To reorder the chips you can handle the event using the [`IgxChipsAreaComponent`]({environment:angularApiUrl}/classes/igxchipsareacomponent.html). More about it could be found in [`Reorder Chips section`](chip.md#reorder-chips).
203137
204138
### Chip Templates
205139

@@ -266,6 +200,71 @@ You can customize the `remove icon`, using the [`removeIcon`]({environment:angul
266200
</ng-template>
267201
```
268202

203+
<div class="divider"></div>
204+
205+
### Demo
206+
207+
To create the demo sample below, we will use the features above:
208+
209+
```html
210+
<igx-chip
211+
*ngFor="let chip of chipList"
212+
[id]="chip.id"
213+
[selectable]="true"
214+
[removable]="true"
215+
(remove)="chipRemoved($event)"
216+
>
217+
<igx-icon igxPrefix>{{chip.icon}}</igx-icon>
218+
{{chip.text}}
219+
</igx-chip>
220+
```
221+
222+
Then, we need to add the `chipList` and the function, that handles the [`remove`]({environment:angularApiUrl}/classes/igxchipcomponent.html#remove) event:
223+
224+
```ts
225+
import { IBaseChipEventArgs } from 'igniteui-angular';
226+
// import { IBaseChipEventArgs } from '@infragistics/igniteui-angular'; for licensed package
227+
...
228+
public chipList = [
229+
{
230+
text: 'Country',
231+
id: '1',
232+
icon: 'place'
233+
},
234+
{
235+
text: 'City',
236+
id: '2',
237+
icon: 'location_city'
238+
},
239+
{
240+
text: 'Town',
241+
id: '3',
242+
icon: 'store'
243+
},
244+
{
245+
text: 'First Name',
246+
id: '4',
247+
icon: 'person_pin'
248+
}
249+
];
250+
251+
private changeDetectionRef: any;
252+
253+
public chipRemoved(event: IBaseChipEventArgs) {
254+
this.chipList = this.chipList.filter((item) => {
255+
return item.id !== event.owner.id;
256+
});
257+
this.changeDetectionRef.detectChanges();
258+
}
259+
```
260+
If everything went well, you should see this in your browser:
261+
262+
263+
<code-view style="height: 100px; padding-top: 10px"
264+
data-demos-base-url="{environment:demosBaseUrl}"
265+
iframe-src="{environment:demosBaseUrl}/data-display/chip-simple" >
266+
</code-view>
267+
269268
## Chip Area
270269

271270
The [`IgxChipsAreaComponent`]({environment:angularApiUrl}/classes/igxchipsareacomponent.html) is used when handling more complex scenarios that require interaction between chips (dragging, selection, navigation, etc.).

jp/components/chip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public chipRemoved(event: IBaseChipEventArgs) {
125125

126126
### ドラッグ
127127

128-
ドラッグは、[`draggable`]({environment:angularApiUrl}/classes/igxchipcomponent.html#removable) 入力を `true` に設定して有効にできます。有効にすると、チップをクリックしてドラッグできます。
128+
ドラッグは、[`draggable`]({environment:angularApiUrl}/classes/igxchipcomponent.html#draggable) 入力を `true` に設定して有効にできます。有効にすると、チップをクリックしてドラッグできます。
129129

130130
```html
131131
<igx-chip *ngFor="let chip of chipList" [id]="chip.id" [draggable]="true">

0 commit comments

Comments
 (0)