diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 4a8b354..91a3fa4 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -1,4 +1,4 @@ - + Hi, there! Select or create a page to get started. diff --git a/src/app/pages/editor/editor.page.ts b/src/app/pages/editor/editor.page.ts index 117048a..1fa436e 100644 --- a/src/app/pages/editor/editor.page.ts +++ b/src/app/pages/editor/editor.page.ts @@ -2,7 +2,7 @@ import {Component, Host, OnInit, ViewChild, ViewChildren} from '@angular/core'; import HostRecord from '../../structures/HostRecord'; import PageRecord from '../../structures/PageRecord'; import {PageService} from '../../service/page.service'; -import {ActivatedRoute} from '@angular/router'; +import {ActivatedRoute, Router} from '@angular/router'; @Component({ selector: 'app-editor', @@ -20,15 +20,14 @@ export class EditorPage implements OnInit { constructor( protected pages: PageService, protected route: ActivatedRoute, + protected router: Router, ) { this.route.params.subscribe(params => { this.pageId = params.id; }); } - ngOnInit() { - console.log('Editor component: ', this); - } + ngOnInit() {} ionViewDidEnter() { if ( this.pageId ) { @@ -38,6 +37,8 @@ export class EditorPage implements OnInit { this.hostRecords = hosts; }); }); + } else { + this.router.navigate(['/home']); } }