Angular toast directive seems to ignore options attribute

549 Views Asked by At

working with angular, wanted toast messages...

per this questions i chose angular toast

Fire notification toaster in any controller angularjs

But when i try to set the location thusly

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

it's ignored... unless I modify the actual source

  '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',

At which time the settings here are used, even if they conflict with the modified source.

  1. What am I doing wrong setting the options on the directive markup?
  2. Is there are better angular toaster implementations that's less buggy? (I haven't messed with it yet, but ngToast seems to be better setup , more complete)

I tried a bunch of different ways to set the settings, all were ignored.. when i modified the source, this started to work.

1

There are 1 best solutions below

0
On

I imagine "toast-bottom-right" is a string and should therefore be surrounded with qoutes "", like below.

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