mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
627 B
17 lines
627 B
import { Injectable } from '@angular/core';
|
|
import { Resolve } from '@angular/router';
|
|
import { Store } from '@ngxs/store';
|
|
import { GetTenant } from '../actions/tenant-management.actions';
|
|
import { TenantManagement } from '../models/tenant-management';
|
|
import { TenantManagementState } from '../states/tenant-management.state';
|
|
|
|
@Injectable()
|
|
export class TenantsResolver implements Resolve<TenantManagement.State> {
|
|
constructor(private store: Store) {}
|
|
|
|
resolve() {
|
|
const data = this.store.selectSnapshot(TenantManagementState.get);
|
|
return data && data.length ? null : this.store.dispatch(new GetTenant());
|
|
}
|
|
}
|