UNPKG

globular-mvc

Version:

Generic template to create web-application that made use of globular as backend and materialize as css (wrap in web-component's)

67 lines (44 loc) 1.12 kB
import { Modal } from "materialize-css"; import { Model } from "./Model"; /** * That class made use of the web-component applcation view. */ export class View { protected listeners: Array<any>; constructor() { this.listeners = new Array<any>(); } // Refresh the view. update() { } // Initialyse view listener and other stuff. Must be call after model is init. init() { } appendListener(name: string, uuid: string){ this.listeners.push({name:name, uuid:uuid}) } // Explicitly close the view. close() { // Close the project. this.listeners.forEach((listener: any) => { Model.eventHub.unSubscribe(listener.name, listener.uuid) }) } // Display a user message. static displayMessage(msg: any, delay?: number) { } // Block user input wait(msg: string) { } // Resume user input. resume() { } clear() { } show() { } hide() { } getWorkspace(): any { } }