Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4841

Getting an html element without jquery / this.$()

$
0
0

@midget2000x wrote:

Not that it really matters that much, but I was curious if there was a way to access an HTML element in a component without using this.$()

Example:

export default Component.extend({
	tagName: 'img',
	attributeBindings: ['src'],

	didInsertElement() {
		let _this = this;
		this.$().on('error', function() {
			_this.set('src', missingImage);
		});
	},
	willDestroyElement() {
		this.$().off();
	}
});

Like, how could I access the element with plain javascript?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4841

Latest Images

Trending Articles



Latest Images