fix homepage style and disable direct access to the editor page
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user