尽管按照此问题的其他答案中的说明进行操作,但ng-bootstrap不会显示工具提示

时间:2018-10-07 18:14:40

标签: angular ng-bootstrap

https://github.com/jimshowalter/vocabutron/blob/master/src/app/add-word/add-word.component.html中。按照ng-bootstrap not displaying tooltip的答案中的说明进行操作。这肯定是显而易见的,但我看不到。

1 个答案:

答案 0 :(得分:0)

它显示的工具提示为“ opacity:0”,因此我们看不到它。添加“ tooltipClass”属性并添加“ opacity:1;”到那个班级。例如:

add-word.component.html:

  <button type="submit" class="btn btn-success" [disabled]="!wordForm.form.valid" placement="bottom" ngbTooltip="Use this to add word to learn later" tooltipClass="opacity-1">Learn Later</button>
  <button type="submit" class="btn btn-success" [disabled]="!wordForm.form.valid" (click)="learn()" placement="bottom" ngbTooltip="Use this to add word you've already learned" tooltipClass="opacity-1">I've Learned It</button>

styles.css:

.opacity-1 { opacity: 1; }