forked from NG-ZORRO/ng-zorro-antd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic.ts
30 lines (27 loc) 路 792 Bytes
/
basic.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'nz-demo-mention-basic',
encapsulation: ViewEncapsulation.None,
template: `
<nz-mention [nzSuggestions]="suggestions" (nzOnSelect)="onSelect($event)">
<textarea
rows="1"
placeholder="input here"
nzMentionTrigger
nz-input
[(ngModel)]="inputValue"
(ngModelChange)="onChange($event)"
></textarea>
</nz-mention>
`
})
export class NzDemoMentionBasicComponent {
inputValue: string = '@afc163';
suggestions = ['afc163', 'benjycui', 'yiminghe', 'RaoHai', '涓枃', '銇伝銈撱仈'];
onChange(value: string): void {
console.log(value);
}
onSelect(suggestion: string): void {
console.log(`onSelect ${suggestion}`);
}
}