3

I have an angular-cli application and need to include tooltip for a button here is my app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {BenefitsManagementModule} from './benefits-management/benefits-management.module';
import { AppComponent } from './app.component';
import { LoginComponent } from './login/login.component';
import { AuthService } from './auth/auth.service';
import {AppRoutingModule} from './app-routing.module';
import { TooltipModule } from 'ngx-bootstrap';

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    BenefitsManagementModule,
    AppRoutingModule,
     TooltipModule.forRoot()
  ],
  providers: [
    AuthService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { };

here is my html for button

<div style="margin:0 auto; width: 65%; margin-top:3%;">
    <button type="submit"  
            [disabled]="!benefitScheduleForm.valid" 
            class="btn btn-md btn-primary" 
            style="float:left;"
            >Add
    </button>
    <button type="button" 
            tooltip="mytooltip"  
            class="btn btn-md btn-primary" 
            style="float:right;" 
            (click)="cancel()">Cancel</button>
</div>

Can anybody help me out?

5
  • whats the problem you are facing ?? Commented Sep 1, 2017 at 12:35
  • the tooltip not showing up Commented Sep 1, 2017 at 12:58
  • can you produce a plunk for the same Commented Sep 1, 2017 at 13:06
  • its angular-cli project Commented Sep 1, 2017 at 13:49
  • doesnt matter,you will have angular seed project online Commented Sep 1, 2017 at 13:52

1 Answer 1

2

I was facing the same issue. The solution was to set the opacity property to 100.

.tooltip {
  opacity: 100;
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.