loop-modules
Version:
Shared modules for the Loop product suite.
88 lines (87 loc) • 3.87 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
// angular
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
// libs
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
// app
import { LoopUserService } from './loop-user.service';
import { EmployeeService } from './employee.service';
import { LoopActivityService } from './loop-activity.service';
import { LoopTrendingActivityService } from './loop-trending-activity.service';
import { LoopActivityMessageService } from './loop-activity-message.service';
import { LoopAssignmentService } from './loop-assignment.service';
import { LoopScenarioService } from './loop-scenario.service';
import { LoopTopicService } from './loop-topic.service';
import { LoopDocumentService } from './loop-document.service';
import { LoopSessionService } from './loop-session.service';
import { MediaService } from './media-service.service';
var CoreService = (function () {
function CoreService(http, activityMessages, users, assignments, scenarios, topics, documents, sessions, employees, activities, trendingActivities, media) {
this.http = http;
this.activityMessages = activityMessages;
this.users = users;
this.assignments = assignments;
this.scenarios = scenarios;
this.topics = topics;
this.documents = documents;
this.sessions = sessions;
this.employees = employees;
this.activities = activities;
this.trendingActivities = trendingActivities;
this.media = media;
this._searchSource = new BehaviorSubject('');
this.search$ = this._searchSource.asObservable();
}
CoreService.prototype.onSearch = function (searchPhrase) {
this._searchSource.next(searchPhrase);
};
Object.defineProperty(CoreService.prototype, "config", {
get: function () {
return this.http.get('ma_core/api/v2/configuration').map(function (res) { return res.json(); });
},
enumerable: true,
configurable: true
});
Object.defineProperty(CoreService.prototype, "uuid", {
get: function () {
var d = new Date().getTime();
if (window.performance && typeof window.performance.now === 'function') {
d += performance.now();
}
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
},
enumerable: true,
configurable: true
});
return CoreService;
}());
CoreService = __decorate([
Injectable(),
__metadata("design:paramtypes", [Http,
LoopActivityMessageService,
LoopUserService,
LoopAssignmentService,
LoopScenarioService,
LoopTopicService,
LoopDocumentService,
LoopSessionService,
EmployeeService,
LoopActivityService,
LoopTrendingActivityService,
MediaService])
], CoreService);
export { CoreService };