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.
63 lines
1.1 KiB
63 lines
1.1 KiB
import { Observer } from "../observe/Observer";
|
|
import { Model } from "../model/AbstractModel";
|
|
import { Subject } from "../observe/Observable";
|
|
import { View } from "./AbstractView";
|
|
import { Controller } from "../controller/AbstractController";
|
|
|
|
export class UserView implements Observer, View {
|
|
private _model: Model;
|
|
private _element: any;
|
|
|
|
|
|
|
|
constructor(model: Model, element: any) {
|
|
this._model = model;
|
|
this._element = element;
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* Getter model
|
|
* @return {Model}
|
|
*/
|
|
public get model(): Model {
|
|
return this._model;
|
|
}
|
|
|
|
|
|
/**
|
|
* Getter element
|
|
* @return {any}
|
|
*/
|
|
public get element(): any {
|
|
return this._element;
|
|
}
|
|
|
|
/**
|
|
* Setter model
|
|
* @param {Model} value
|
|
*/
|
|
public set model(value: Model) {
|
|
this._model = value;
|
|
}
|
|
|
|
|
|
/**
|
|
* Setter element
|
|
* @param {any} value
|
|
*/
|
|
public set element(value: any) {
|
|
this._element = value;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
update(data: any): void {
|
|
this.element = data;
|
|
console.log(this.element);
|
|
}
|
|
|
|
}
|