FlowRouter > How to cancel render of Template when start redirect?


#1

onRendered executed anyway:

  onCreated: ->
    route = FlowRouter.getParam('user')
    @user = findUser(route)
    FlowRouter.go('notFound') if not @user
  onRendered: ->
    $('#userName').text(@user.name)

GitHub Issue


#2

Help me please! :slight_smile:

IronRouter does not have this problem. console.log('onRendered'); does not call in this test:

Template.login.onCreated(function() {
	console.log('onCreated');
	Router.go('/restore-password');
});

Template.login.onRendered(function() {
	console.log('onRendered');
});

#3

Oh-oh-oh, related issues: