Start refactoring state management
This commit is contained in:
parent
ca0bf943f7
commit
a9ad628488
31 changed files with 410 additions and 360 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { ModalService } from '../../../../services/modal.service';
|
||||
import { DataService } from '../../../../services/data.service';
|
||||
import { Page } from '../../../../model/page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
|
|
@ -8,12 +9,16 @@ import { DataService } from '../../../../services/data.service';
|
|||
styleUrls: ['./settings.component.scss']
|
||||
})
|
||||
export class SettingsComponent {
|
||||
constructor(public modalService: ModalService, public dataService: DataService) {}
|
||||
constructor(public modalService: ModalService, public dataService: DataService) {
|
||||
this.modalService.active.input.subscribe(p => (this.page = p));
|
||||
}
|
||||
|
||||
page: Page;
|
||||
|
||||
async deletePage() {
|
||||
try {
|
||||
await this.modalService.showRemovePage(this.dataService.active.name);
|
||||
this.dataService.remove();
|
||||
await this.modalService.showRemovePage(this.page.name);
|
||||
this.dataService.removePage(this.page);
|
||||
this.modalService.submit();
|
||||
} catch {
|
||||
// pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue