bia-framework
Version:
Bia Framework to work with angular 2
80 lines • 3.96 kB
JavaScript
"use strict";
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);
};
var core_1 = require("@angular/core");
var Subject_1 = require("rxjs/Subject");
var CoreBarService = (function () {
function CoreBarService() {
var _this = this;
this._dropDownItemsSubject = new Subject_1.Subject();
this.DropDownItemsChanged = this._dropDownItemsSubject.asObservable();
this._leftItemsSubject = new Subject_1.Subject();
this.LeftItensChanged = this._leftItemsSubject.asObservable();
this._rightItemsSubject = new Subject_1.Subject();
this.RightItensChanged = this._rightItemsSubject.asObservable();
this._TitleSubject = new Subject_1.Subject();
this.TitleChanged = this._TitleSubject.asObservable();
this.contentVisibilityChanged = new Subject_1.Subject();
this.nativeVisibilityChanged = new Subject_1.Subject();
this._DynamicContentSubject = new Subject_1.Subject();
this.DynamicContentChanged = this._DynamicContentSubject.asObservable();
this._BarBgVisibilitySubject = new Subject_1.Subject();
this.BarBgVisibilityChanged = this._BarBgVisibilitySubject.asObservable();
this.addDropdownItem = function (newDropdown) {
_this._dropDownItensStore.push(newDropdown);
_this._dropDownItemsSubject.next(_this._dropDownItensStore);
};
this.addLeftMenuItem = function (newItem) {
_this._leftItensStore.push(newItem);
_this._leftItemsSubject.next(_this._leftItensStore);
};
this.clearLeftMenuItens = function () {
_this._leftItensStore = [];
_this._leftItemsSubject.next(_this._leftItensStore);
};
this.clearRightMenuItens = function () {
_this._rightItensStore = [];
_this._rightItemsSubject.next(_this._rightItensStore);
};
this.clearDropdownItems = function () {
_this._dropDownItensStore = [];
_this._dropDownItemsSubject.next(_this._dropDownItensStore);
};
this.addRightMenuItem = function (newItem) {
_this._rightItensStore.push(newItem);
_this._rightItemsSubject.next(_this._rightItensStore);
};
this.setNativeVisibility = function (v) {
_this.nativeVisibilityChanged.next(v);
};
this.setContentVisibility = function (v) {
_this.contentVisibilityChanged.next(v);
};
this.setBarBgVisibility = function (v) {
_this._BarBgVisibilitySubject.next(v);
};
this.setTittle = function (newTitle) {
_this._TitleSubject.next(newTitle);
};
this.loadDynamicComponent = function (dynamicContent) {
_this._DynamicContentSubject.next(dynamicContent);
};
this._leftItensStore = [];
this._rightItensStore = [];
this._dropDownItensStore = [];
}
CoreBarService = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], CoreBarService);
return CoreBarService;
}());
exports.CoreBarService = CoreBarService;
//# sourceMappingURL=core-bar.service.js.map