Instance from external library


#1

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?


#2

Hi , this blog may be helpful https://mavilein.github.io/javascript/2013/08/01/Ember-JS-After-Render-Event/

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