jeudi 3 janvier 2019

EmberJS - HTML string compile with actions

I have the following HTML string and I want to render it dynamically including with the onclick event listener. How to do it in EmberJS?

hello.js

export default Ember.Component.extend({
    didInsertElement() {
        var message = `
            <p>Hello World!</p>
            <a onclick=>Learn More</a>
        `;
        this.set('message', message);
    },

    actions: {
        handleOpenUrl() {
            //open url code
        }
    }
});

hello.hbs

}




Aucun commentaire:

Enregistrer un commentaire