Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as kontainer from "kontainer";
- import * as ko from "knockout";
- import {endpoints} from "Startup/AppConfig"
- import {LocationService} from "ViewModels/Setup/GeoFile/data/location.service";
- import {SiteService} from "Components/SiteSelector/Site.service";
- import {HttpService, HttpServiceDecorator} from "Infrastructure/HttpService";
- import {ListCategoryService, ListNameService, ListValueService} from "DataAccess/CodeList/CodeListServices";
- export function registerDependencies() {
- const factories = {
- "HttpService": [() => new HttpServiceDecorator(new HttpService())],
- "LocationService": ["HttpService", (http) => new LocationService(endpoints.location, http)],
- "SiteService": ["HttpService", (http) => new SiteService(endpoints.site, http)],
- "ListCategoryService": ["HttpService", (http) => new ListCategoryService(endpoints.listCategory, http)],
- "ListNameService": ["HttpService", (http) => new ListNameService(endpoints.listName, http)],
- "ListValueService": ["HttpService", (http) => new ListValueService(endpoints.listValue, http)]
- };
- for (let key in factories) {
- if (factories.hasOwnProperty(key)) {
- kontainer.registerFactory(key, factories[key]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment