feat: add navigator service
This commit is contained in:
parent
781599e2b7
commit
06f6efe023
@ -1,7 +1,28 @@
|
||||
import {Routes} from '@angular/router';
|
||||
import {Routes} from '@angular/router';
|
||||
import {ScheduleComponent} from "@page/schedule/schedule.component";
|
||||
import {WelcomeComponent} from "@page/setup/welcome/welcome.component";
|
||||
import {DatabaseComponent} from "@page/setup/database/database.component";
|
||||
import {CacheComponent} from "@page/setup/cache/cache.component";
|
||||
import {LoggingComponent} from "@page/setup/logging/logging.component";
|
||||
import {ScheduleComponent as SetupScheduleComponent} from "@page/setup/schedule/schedule.component";
|
||||
import {SetupComponent} from "@page/setup/setup.component";
|
||||
import {CreateAdminComponent} from "@page/setup/create-admin/create-admin.component";
|
||||
import {SummaryComponent} from "@page/setup/summary/summary.component";
|
||||
|
||||
export const routes: Routes = [];
|
||||
export const routes: Routes = [
|
||||
{path: '', title: 'Расписание', pathMatch: 'full', component: ScheduleComponent},
|
||||
{
|
||||
path: 'setup', title: 'Установка', component: SetupComponent, children: [
|
||||
{path: 'welcome', component: WelcomeComponent},
|
||||
{path: 'database', component: DatabaseComponent},
|
||||
{path: 'cache', component: CacheComponent},
|
||||
{path: 'create-admin', component: CreateAdminComponent},
|
||||
{path: 'schedule', component: SetupScheduleComponent},
|
||||
{path: 'logging', component: LoggingComponent},
|
||||
{path: 'summary', component: SummaryComponent},
|
||||
{path: '', redirectTo: 'welcome', pathMatch: 'full'}
|
||||
]
|
||||
}
|
||||
/*{path: 'not-found', title: '404 страница не найдена'},
|
||||
{path: '**', redirectTo: '/not-found'}*/
|
||||
];
|
||||
|
18
src/services/navigation.service.ts
Normal file
18
src/services/navigation.service.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import {EventEmitter, Injectable} from '@angular/core';
|
||||
import {BehaviorSubject, Observable} from "rxjs";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NavigationService {
|
||||
private nextButtonState = new BehaviorSubject<boolean>(false);
|
||||
|
||||
nextButtonState$ = this.nextButtonState.asObservable();
|
||||
nextButtonAction!: () => Observable<boolean>;
|
||||
|
||||
skipNavigation: EventEmitter<() => Observable<boolean>> = new EventEmitter();
|
||||
|
||||
setNextButtonState(state: boolean) {
|
||||
this.nextButtonState.next(state);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user