ngx-restangular-jc
Version:
19 lines (12 loc) • 438 B
text/typescript
import { InjectionToken } from '@angular/core';
import { isArray } from 'lodash';
export const RESTANGULAR = new InjectionToken<string>('restangularWithConfig');
export function RestangularFactory([callbackOrServices, callback]) {
let arrServices = [];
let fn = callbackOrServices;
if (isArray(callbackOrServices)) {
arrServices = callbackOrServices;
fn = callback;
}
return {fn, arrServices};
}