dialog.component.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var rxjs_1 = require("rxjs");
  4. var DialogComponent = (function () {
  5. function DialogComponent(dialogService) {
  6. this.dialogService = dialogService;
  7. }
  8. DialogComponent.prototype.fillData = function (data) {
  9. var _this = this;
  10. data = data || {};
  11. var keys = Object.keys(data);
  12. for (var i = 0, length_1 = keys.length; i < length_1; i++) {
  13. var key = keys[i];
  14. this[key] = data[key];
  15. }
  16. return rxjs_1.Observable.create(function (observer) {
  17. _this.observer = observer;
  18. return function () {
  19. _this.close();
  20. };
  21. });
  22. };
  23. DialogComponent.prototype.close = function () {
  24. this.dialogService.removeDialog(this);
  25. };
  26. DialogComponent.prototype.ngOnDestroy = function () {
  27. if (this.observer) {
  28. this.observer.next(this.result);
  29. }
  30. };
  31. return DialogComponent;
  32. }());
  33. exports.DialogComponent = DialogComponent;
  34. //# sourceMappingURL=dialog.component.js.map