-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
tooltip-tplwithcontext.html
53 lines (49 loc) · 1.08 KB
/
tooltip-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
<p>You can optionally pass in a context when manually triggering a tooltip.</p>
<ng-template #tipContent let-greeting="greeting"
>{{ greeting }}, <b>{{ name }}</b
>!</ng-template
>
<div class="buttons">
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbTooltip]="tipContent"
triggers="manual"
#t1="ngbTooltip"
(click)="toggleWithGreeting(t1, 'Bonjour')"
>
French
</button>
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbTooltip]="tipContent"
triggers="manual"
#t2="ngbTooltip"
(click)="toggleWithGreeting(t2, 'Gutentag')"
>
German
</button>
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbTooltip]="tipContent"
triggers="manual"
#t3="ngbTooltip"
(click)="toggleWithGreeting(t3, 'Hello')"
>
English
</button>
</div>
<hr />
<p>Alternatively you can pass in a default context when triggering a tooltip.</p>
<div class="buttons">
<button
type="button"
class="btn btn-outline-secondary me-2"
[ngbTooltip]="tipContent"
[tooltipContext]="{ greeting: '你好' }"
>
French
</button>
</div>