【问题标题】:Angular toast directive seems to ignore options attributeAngular toast 指令似乎忽略了 options 属性
【发布时间】:2015-08-07 20:48:04
【问题描述】:

处理有角度的、想要的 toast 消息...

根据这个问题,我选择了角度吐司

Fire notification toaster in any controller angularjs

但是当我尝试这样设置位置时

 <toaster-container toaster-options='{ "time-out": 15000, "animation-class": toast-bottom-right,  "position-class": toast-bottom-right }'></toaster-container>

它被忽略了...除非我修改实际来源

  'position-class': 'toast-bottom-right', // Options (see CSS):// I changed this manually to work around a bug that ingnored this setting - EWB
            // 'toast-top-full-width', 'toast-bottom-full-width', 'toast-center',
            // 'toast-top-left', 'toast-top-center', 'toast-top-right',
            // 'toast-bottom-left', 'toast-bottom-center', 'toast-bottom-right',

这里的设置在什么时候使用,即使它们与修改后的源冲突。

  1. 在指令标记上设置选项时我做错了什么?
  2. 是否有更好的角烤面包机实现更少错误? (我还没有弄乱它,但 ngToast 似乎更好的设置,更完整)

我尝试了很多不同的方法来设置设置,都被忽略了。当我修改源时,这开始起作用了。

【问题讨论】:

    标签: angularjs toastr ngtoast


    【解决方案1】:

    我想 "toast-bottom-right" 是一个字符串,因此应该用 qoutes "" 包围,如下所示。

    <toaster-container toaster-options='{ "time-out": 15000, "animation-class": "toast-bottom-right",  "position-class": "toast-bottom-right" }'></toaster-container>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-28
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-06
      相关资源
      最近更新 更多