Toastr and ember.js

Is the toastr popup library not working with Ember due to the direct manipulation of dom, which ember doesn't like? Are there other libraries like this that work well with ember?

Edit

Even in the working example published below, I could not get this to work locally. I finally used Pine Notify , which worked right away.

+5
source share
1 answer

Ember, . " " . , , {{action}}, . :

<script type="text/x-handlebars" >
    <button class="btn btn-info" {{action showInfo}}>Info</button>
</script>

, showInfo, Controller, , :

App.ApplicationController = Em.ArrayController.extend({
    showInfo: function() {
        toastr.info('This is some sample information');
    }
});

; click, , , :

App.OtherView = Em.View.extend({
    click: function(e) {
        toastr.error('This is some sample error');
    }
});

Handlebars , , click , :

{{#view App.OtherView class="btn btn-danger"}}
    Error
{{/view}}

JSFiddle: http://jsfiddle.net/schawaska/YZwDh/

Ember {{action}}

+8

All Articles