dart - Angular Dart中的工具提示

标签 dart angular-dart

我正在尝试实现类似于在Angular Material应用程序中将如何实现的工具提示,但这在Angular Dart示例应用程序中不起作用。我在尝试:

<button mat-raised-button
    tooltip="test"
    title="test 123"
    matTooltip="By default, I delay"
    aria-label="Button that displays a tooltip that has custom delays 
    through a default config">
  Button with delay-default tooltip
</button>

我也尝试过:
  <p>Use the [trailing] content selector to add a tooltip.</p>
  <material-input label="With a tooltip">
    <material-icon
        trailing
        tooltipTarget
        size="medium"
        icon="help_outline"
        #tooltipRef="tooltipTarget">
    </material-icon>
  </material-input>
  <material-tooltip-card [for]="tooltipRef">
    This is a paper tooltip!
  </material-tooltip-card>

从此作为来源(https://dart-lang.github.io/angular_components/#/material_tooltip),我也尝试过
<button materialTooltip="abc">test</button>

没有一个工作。如何在悬停时显示简单的工具提示?

最佳答案

确保您注册了必需的提供程序

  providers: [
    popupBindings,
    tooltip.materialTooltipBindings,
  ],

就像完成

https://github.com/dart-lang/angular_components_example/blob/fecf215d65a19be97fd248036640e297161c49e3/example/material_tooltip_example/lib/material_tooltip_example.dart#L37-L40

在AppComponent中一次注册它们应该对整个应用程序有效。

关于dart - Angular Dart中的工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53491924/

相关文章:

dart - 如何在Dart中设置@RouteConfig

angularjs - 可能不使用信息架构(IA)的Angular(Dart)Web应用程序路线设计指南

dart - AngularDart 路由 : Optional parameter

dart - 太多导入导致 `pub serve` 挂起

angular - 如何将 Cordova 应用程序从 Angular Dart 1 转换为 Angular 2?

user-interface - Flutter TabBarView 子项因高度无限制无法渲染

firebase - Flutter:当 TextView 聚焦时,屏幕键盘不打开

user-interface - 如何在 flutter 的标签栏后面添加阴影?

dart - 如何在 Dart 中使用格式良好的箭头函数?

dart - 如何从 angular dart 访问现有的 javascript 库