这是我的用户模型,是否正确?我可以添加方法????
export class User {
id: number;
login: string;
hash: string;
salt: string;
fname: string;
lname: string;
sname: string;
phone: string;
addTime: string;
isActive: boolean;
}
答案 0 :(得分:1)
这只是我复制的原型
export class Model{ //something like this for getter and setters and also other methods
private _keyValue: number;
private _computedValue: number;
getKeyValue(): number{
return this._keyValue;
}
setKeyValue(value: number){
this._keyValue = value;
}
getComputedValue(): number{
return this._computedValue;
}
customeMethod(){}
}