Skip to content

Commit

Permalink
Refactor typo
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 23, 2023
1 parent b337a3d commit e15d91c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/app/showcase/doc/chips/commaseparator.doc.ts
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;
}`
};
}
42 changes: 42 additions & 0 deletions src/app/showcase/doc/chips/regexpseparator.doc.ts
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 = /,| /;
}`
};
}

0 comments on commit e15d91c

Please sign in to comment.