How to use Blaze.remove()


#1

Hi,

I can’t figure out how to correctly do the Blaze.remove()

I have this:

Template.createGame.events({
	'click #createGameStart': function(template) {
		$( "#createGame" ).remove();
		Blaze.render(Template.gameName, document.getElementById('createGameNow'))
	}
})

Template.gameName.events({
	'click .edasi': function() {
		Blaze.remove(Template.gameName)
		Blaze.render(Template.QA, document.getElementById('createGameNow'))
	}
})

I want to remove old Template and render new into the same DOMnode. But I get:

view.js:679 Uncaught Error: Expected template rendered with Blaze.render


#2
Template.gameName.events({
	'click .edasi': function() {
		// change Blaze.remove(Template.gameName) to 
		Blaze.remove(Blaze.currentView)
		Blaze.render(Template.QA, document.getElementById('createGameNow'))
	}
})