node-web-mvc
Version:
node spring mvc
44 lines (43 loc) • 1 kB
TypeScript
/**
* @module ModelAndView
* @description 数据视图类,返回此结果,最终会使用指定模板来返回html内容
*/
import HttpStatus from '../http/HttpStatus';
import View from '../view/View';
export default class ModelAndView {
/**
* 视图名称
*/
view: string | View;
/**
* 视图使用的模型数据
*/
model: any;
status: HttpStatus;
/**
* 用来标识当前数据视图是否已清空
*/
private cleared;
/**
* 判断当前模型数据是否为空
*/
isEmpty(): boolean;
/**
* 判断当前模型是否已清空
*/
wasCleared(): () => boolean;
/**
* 数据视图实例
* @param view 视图名称
* @param model 视图数据
*/
constructor(view?: string | View, model?: any, status?: HttpStatus);
/**
* 清空实例数据
*/
clear(): void;
/**
* 添加一个属性到model中去
*/
addObject(name: any, data: any): void;
}