Optimize potentially expensive call to hasChildren

if not needed (no {{children}} identifier in template nor used in nav condition)