/ Tooltip / How To / Tooltip Content Template
Search results

Tooltip Content Template in Angular Tooltip component

21 Dec 2022 / 1 minute to read

The Tooltip component content can be loaded through template support. Refer to the below code snippet.

Copied to clipboard
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';

@Component({
    selector: 'my-app',
    template: `
    <ejs-tooltip style="display:block;position:absolute;left:calc( 50% - 60px);top:45%;">
            <button ejs-button >Show Tooltip</button>
            <ng-template #content >
              Tooltip content here!!!
            </ng-template>
        </ejs-tooltip>
    `,
    encapsulation: ViewEncapsulation.None
})

export class AppComponent {
}
Copied to clipboard
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TooltipModule } from '@syncfusion/ej2-angular-popups';
import { AppComponent } from './app.component';
import { ButtonModule } from '@syncfusion/ej2-angular-buttons';
/**
 * Module
 */
@NgModule({
    imports: [
        BrowserModule,
        TooltipModule, ButtonModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }
Copied to clipboard
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);
Copied to clipboard
#loader {
  color: #008cff;
  font-family: 'Helvetica Neue', 'calibiri';
  font-size: 16px;
  height: 40px;
  left: 45%;
  position: absolute;
  top: 45%;
  width: 30%;
}
  .tooltipContent {
    margin: 50px;
  }

  #container {
      height: 380px;
  }

  .text {
      text-transform: capitalize;
      width: 155px;
  }

  .header {
      font-family: "Arial Black", Gadget, sans-serif;
      font-size: 12px;
      padding-bottom: 2px;
      margin: 4px -7px 7px -7px;
      padding-right: 5px;
      padding-left: 6px;
      font-weight: bold;
      height: 18px;
      border-bottom: 1px solid white;
  }