All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.endpoints.examples.0.3.0.source-code.api.module.ts Maven / Gradle / Ivy

import { NgModule, ModuleWithProviders, Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SecondTypeScriptEndpoint } from './secondtypescriptendpoint.generated';
import { TestTypeScriptEndpoint } from './testtypescriptendpoint.generated';
import { LombokTypeScriptEndpoint } from './lomboktypescriptendpoint.generated';

@Injectable()
export interface ServiceConfig {
    context?: string;
    debug?: boolean;
    onError()?: Observable;
}

@NgModule({})
export class APIModule {
    static forRoot(serviceConfig: ServiceConfig = {context: ''}): ModuleWithProviders {
        return {
            ngModule: APIModule,
            providers: [
                {provide: ServiceConfig, useValue: serviceConfig},
                SecondTypeScriptEndpoint,
                TestTypeScriptEndpoint,
                LombokTypeScriptEndpoint
            ]
        };
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy