Maybe someone can see what my be happening here because I can’t figure out what it is.
I have created a very simple service to manage the state of my notification component and has methods to show and hide the notification.
import Ember from 'ember';
export default Ember.Service.extend({
success: true,
message: "Hey there!",
notify(params) {
console.log(params);
this.setProperties(params);
Ember.$('.notification-message').addClass('show');
},
closeNotification() {
Ember.$('.notification-message').removeClass('show');
}
});
The notify method is taking in params and setting those properties which the component uses to display the message
{{notification.message}}
And set the success/error class
notification: Ember.inject.service(),
classNameBindings: ['notification.success:success:error'],
When I want to show the message I simply
self.get('notification').notify({message: "You are currently the highest bidder!",success: true});
This all works up to this point, however when I try setting success to false
self.get('notification').notify({message: "You are currently the highest bidder!",success: false});
The notification component never gets the show
class added to it, the message gets set and the class gets set to error, but the show class is never added and thus the notification never shows. This seems to be only happening when I add false
to success.
Any thoughts why this might be occurring?