Instance from external library

I’m using ember-cli and I added a library through bower/broccoli.

I can use this library in my templates just like this:

<script>
    new LibraryObject().doStuff();
</script>

I used didInsertElement():

Ember.View.extend({
    didInsertElement: function () {
        new LibraryObject().doStuff();
    }
})

It didn’t work, I keep getting not defined errors. So any ideas?

Hi , this blog may be helpful Ember JS - How to execute jQuery logic correctly after your View has been rendered

I’m a new user, so I’m not sure if this is the right way. It solved my problem though.

1 Like