A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.1 KiB

  1. import { Observer } from "../observe/Observer";
  2. import { Model } from "../model/AbstractModel";
  3. import { Subject } from "../observe/Observable";
  4. import { View } from "./AbstractView";
  5. import { Controller } from "../controller/AbstractController";
  6. export class UserView implements Observer, View {
  7. private _model: Model;
  8. private _element: any;
  9. constructor(model: Model, element: any) {
  10. this._model = model;
  11. this._element = element;
  12. }
  13. /**
  14. * Getter model
  15. * @return {Model}
  16. */
  17. public get model(): Model {
  18. return this._model;
  19. }
  20. /**
  21. * Getter element
  22. * @return {any}
  23. */
  24. public get element(): any {
  25. return this._element;
  26. }
  27. /**
  28. * Setter model
  29. * @param {Model} value
  30. */
  31. public set model(value: Model) {
  32. this._model = value;
  33. }
  34. /**
  35. * Setter element
  36. * @param {any} value
  37. */
  38. public set element(value: any) {
  39. this._element = value;
  40. }
  41. update(data: any): void {
  42. this.element = data;
  43. console.log(this.element);
  44. }
  45. }