-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
popover-tplwithcontext.html
57 lines (54 loc) · 1.33 KB
/
popover-tplwithcontext.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<p>You can optionally pass in a context when manually triggering a popover.</p>
<ng-template #popContent let-greeting="greeting"
>{{ greeting }}, <b>{{ name }}</b
>!</ng-template
>
<ng-template #popTitle let-language="language">Greeting in {{ language }}</ng-template>
<div class="buttons">
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbPopover]="popContent"
[popoverTitle]="popTitle"
triggers="manual"
#p1="ngbPopover"
(click)="toggleWithGreeting(p1, 'Bonjour', 'French')"
>
French
</button>
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbPopover]="popContent"
[popoverTitle]="popTitle"
triggers="manual"
#p2="ngbPopover"
(click)="toggleWithGreeting(p2, 'Gutentag', 'German')"
>
German
</button>
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbPopover]="popContent"
[popoverTitle]="popTitle"
triggers="manual"
#p3="ngbPopover"
(click)="toggleWithGreeting(p3, 'Hello', 'English')"
>
English
</button>
</div>
<hr />
<p>Alternatively you can also pass in a default context when triggering a popover.</p>
<div class="buttons">
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbPopover]="popContent"
[popoverTitle]="popTitle"
[popoverContext]="{ language: '中文', greeting: '你好' }"
>
Chinese
</button>
</div>