-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tag): add nxTagIntl provider for i18n (#1246)
- Loading branch information
1 parent
56b12bd
commit a4b9ffd
Showing
11 changed files
with
119 additions
and
8 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...ntation/examples/progressbar/progressbar-custom-range/progressbar-custom-range-example.ts
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
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
1 change: 1 addition & 0 deletions
1
projects/ng-aquila/documentation/examples/taglist/taglist-intl/taglist-intl-example.html
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 @@ | ||
<nx-taglist [tags]="tags" [allowTagDeletion]="true"> </nx-taglist> |
Empty file.
28 changes: 28 additions & 0 deletions
28
projects/ng-aquila/documentation/examples/taglist/taglist-intl/taglist-intl-example.ts
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,28 @@ | ||
import { ChangeDetectionStrategy, Component, Injectable } from '@angular/core'; | ||
import { NxTagIntl, NxTaglistComponent } from '@aposin/ng-aquila/taglist'; | ||
|
||
@Injectable() | ||
class MyIntl extends NxTagIntl { | ||
deleteAriaLabel = 'Tag löschen'; | ||
} | ||
|
||
/** | ||
* @title Tag Internationalization Example | ||
*/ | ||
@Component({ | ||
selector: 'taglist-intl-example', | ||
standalone: true, | ||
imports: [NxTaglistComponent], | ||
templateUrl: './taglist-intl-example.html', | ||
styleUrl: './taglist-intl-example.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [ | ||
{ | ||
provide: NxTagIntl, | ||
useClass: MyIntl, | ||
}, | ||
], | ||
}) | ||
export class TaglistIntlExampleComponent { | ||
tags = ['Apples', 'Oranges', 'Bananas', 'Strawberries', 'Melons', 'Lemons']; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './tag.component'; | ||
export * from './tag-intl'; | ||
export * from './taglist.component'; | ||
export * from './taglist.module'; |
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,16 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Subject } from 'rxjs'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class NxTagIntl { | ||
/** | ||
* Stream that emits whenever the labels here are changed. Use this to notify | ||
* components if the labels have changed after initialization. | ||
*/ | ||
readonly changes = new Subject<void>(); | ||
|
||
/** The aria label for the delete button */ | ||
deleteAriaLabel = 'Delete tag'; | ||
} |
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
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
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
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