/** Angular Imports */ import { Injectable } from '@angular/core' ; import { Resolve , ActivatedRouteSnapshot } from '@angular/router' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /** Custom Services */ import { OrganizationService } from '../organization.service' ; /** Custom Imports */ import { BulkImports } from './view-bulk-import/bulk-imports' ; /**
 * Bulk Imports data resolver.
 */ @ Injectable ( ) export class BulkImportResolver implements Resolve < Object > { bulkImportsArray = BulkImports ; param { OrganizationService } organizationService constructor ( private organizationService ) { } param importName getEntityName ( importName ) { const bulkImport = this . bulkImportsArray . find ( ( entry ) => importName === entry . name ) ; return bulkImport . entityType ; } returns { Observable < any > } resolve ( route ) { const entity = this . getEntityName ( route . params [ 'import-name' ] ) ; return this . organizationService . getImports ( entity ) ; } }