-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.ts
More file actions
27 lines (21 loc) · 818 Bytes
/
index.ts
File metadata and controls
27 lines (21 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Mention } from '@syncfusion/ej2-dropdowns';
// defined the array of complex data
let emailData: { [key: string]: Object }[] = [
{ Name: 'Selma Rose', EmailId : 'selma@gmail.com' },
{ Name: 'Maria', EmailId : 'maria@gmail.com' },
{ Name: 'Russo kay', EmailId : 'russo@gmail.com' },
{ Name: 'Robert', EmailId : 'robert@gmail.com' },
{ Name: 'Garth', EmailId : 'garth@gmail.com' }
];
// initialize Mention control
let mentionObject: Mention = new Mention({
//set the data to dataSource property
dataSource: emailData,
// maps the appropriate column to fields property
fields: { text: 'Name', value: 'EmailId' },
mentionChar: '@',
showMentionChar: true,
requireLeadingSpace : false
});
// render initialized Mention
mentionObject.appendTo('#mentionElement');