$ npm install @angular-ru/cdk/tooltip
@import './node_modules/@angular-ru/cdk/tooltip/styles/index';
// ...
import { TooltipModule } from '@angular-ru/cdk/tooltip';
import { NgModule } from '@angular/core';
@NgModule({
imports: [
// ...
TooltipModule.forRoot()
]
})
export class AppModule {}
<div
tooltip="Bottom"
tooltip-placement="bottom"
>
Bottom
</div>
<div
tooltip="Right"
tooltip-placement="right"
>
Right
</div>
<div
tooltip="Left"
tooltip-placement="left"
>
Left
</div>
<div
tooltip="Top"
tooltip-placement="top"
>
Top
</div>
<div
tooltip-placement="bottom"
[tooltip]="tooltipTemplate"
[tooltip-context]="{ name: 'Max' }"
>
Bottom with HTML
</div>
<ng-template
#tooltipTemplate
let-context
>
<span style="text-decoration: underline; color: yellow">Hello {{ context.name }}</span>
</ng-template>