ngOnInit() { if (!localStorage.getItem('foo')) { localStorage.setItem('foo', 'no reload') location.reload() } else { localStorage.removeItem('foo') } }