-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b337a3d
commit e15d91c
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Component } from '@angular/core'; | ||
import { Code } from '../../domain/code'; | ||
|
||
@Component({ | ||
selector: 'chips-comma-separator-demo', | ||
template: ` | ||
<app-docsectiontext> | ||
<p>A new chip is added when <i>enter</i> key is pressed, <i>separator</i> property allows definining an additional key. Currently only valid value is <i>,</i> to create a new item when comma key is pressed.</p> | ||
</app-docsectiontext> | ||
<div class="card p-fluid"> | ||
<p-chips [(ngModel)]="values" separator="," placeholder="Hint: a, b, c"></p-chips> | ||
</div> | ||
<app-code [code]="code" selector="chips-comma-separator-demo"></app-code>` | ||
}) | ||
export class CommaSeparatorDoc { | ||
values: string[] | undefined; | ||
|
||
code: Code = { | ||
basic: ` | ||
<p-chips [(ngModel)]="values" separator="," placeholder="Hint: a, b, c"></p-chips>`, | ||
|
||
html: ` | ||
<div class="card p-fluid"> | ||
<p-chips [(ngModel)]="values" separator="," placeholder="Hint: a, b, c"></p-chips> | ||
</div>`, | ||
|
||
typescript: ` | ||
import { Component } from '@angular/core'; | ||
@Component({ | ||
selector: 'chips-comma-separator-demo', | ||
templateUrl: './chips-comma-separator-demo.html', | ||
}) | ||
export class ChipsCommaseparatorDemo { | ||
values: string[] | undefined; | ||
}` | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Code } from '../../domain/code'; | ||
|
||
@Component({ | ||
selector: 'chips-reg-exp-separator-demo', | ||
template: ` | ||
<app-docsectiontext> | ||
<p>A new chip is added when <i>enter</i> key is pressed, <i>separator</i> property allows definining an additional key. Currently only valid value is , to create a new item when comma key is pressed.</p> | ||
</app-docsectiontext> | ||
<div class="card p-fluid"> | ||
<p-chips [(ngModel)]="values" [separator]="separatorExp" placeholder="Hint: a, b c"></p-chips> | ||
</div> | ||
<app-code [code]="code" selector="chips-reg-exp-separator-demo"></app-code>` | ||
}) | ||
export class RegexpSeparatorDoc { | ||
separatorExp: RegExp = /,| /; | ||
|
||
values: string[] | undefined; | ||
|
||
code: Code = { | ||
basic: ` | ||
<p-chips [(ngModel)]="values" [separator]="separatorExp" placeholder="Hint: a, b c"></p-chips>`, | ||
|
||
html: ` | ||
<div class="card p-fluid"> | ||
<p-chips [(ngModel)]="values" [separator]="separatorExp" placeholder="Hint: a, b c"></p-chips> | ||
</div>`, | ||
|
||
typescript: ` | ||
import { Component } from '@angular/core'; | ||
@Component({ | ||
selector: 'chips-reg-exp-separator-demo', | ||
templateUrl: './chips-reg-exp-separator-demo.html' | ||
}) | ||
export class ChipsRegExpSeparatorDemo { | ||
values: string[] | undefined; | ||
separatorExp: RegExp = /,| /; | ||
}` | ||
}; | ||
} |