### File

`projects/app-base-library/src/lib/angular/modules/wordpress/wordpress.resolve.ts`

### Index

###### Methods

- resolve

### Constructor

`constructor(baseService: BaseService, wordpress: WordpressService)`
Defined in projects/app-base-library/src/lib/angular/modules/wordpress/wordpress.resolve.ts:8

Parameters :

Name | Type | Optional
baseService | `BaseService` | no
wordpress | `WordpressService` | no

### Methods

resolve
`resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot)`
Defined in projects/app-base-library/src/lib/angular/modules/wordpress/wordpress.resolve.ts:12

Parameters :

Name | Type | Optional
route | `ActivatedRouteSnapshot` | no
state | `RouterStateSnapshot` | no

Returns : `any`

    import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
    import { Injectable } from '@angular/core';
    import { BaseService } from '../../services/base.service';
    import { ConfigService } from '../../services/config.service';
    import { WordpressService } from './wordpress.service';

    @Injectable()
    export class WordpressResolve implements Resolve<any> {

        constructor(private baseService: BaseService, private wordpress: WordpressService) { }

        resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
            return new Promise(resolve => {
                // dev
                if (this.baseService.settings['dev'] && this.baseService.settings['wordpress-dev']) {
                    for (const k in this.baseService.settings['wordpress-dev']) {
                        this.baseService.settings['wordpress'][k] = this.baseService.settings['wordpress-dev'][k];
                    }
                }
                // production
                this.wordpress.init(this.baseService.settings['wordpress']).then(() => {
                    resolve(this.wordpress);
                });
            });
        }
    }

# results matching ""

# No results matching ""