How to remove the push createdElement


#1
actions: {
	addToList: function() {
		var task = this.get('controller').get('task');
		var todoList = document.getElementById('todoList');

		console.log(task); 
		var local = [];
		local.push(task);
		todoList.innerHTML += "<li>" + local + "<button class='delete' {{action 'remove'}}>X</button></li><br>";
	},
	remove: function(event) {
		var e = e || event;
		console.log('removed');
		if(e.targetName !== "BUTTON") {
			return false;
		}
		target.parentNode.parentNode.removeChild(target.parentNode);
	}

I want to remove the pushed listitem, the codes above works in vanilla JavaScript. But how could I apply that remove function properly to EmberJS.


#2

check here https://ember-twiddle.com/d648c15ff55acbae4c304534e097abe9?openFiles=templates.application.hbs%2C