0
我在单页应用程序中有一个应用程序。 我也注册和登录外面。打字稿中一页的设计模式
我想知道我是否应该用于登录,注册和密码恢复使用方法:用类
1,标准单例模式。
export class Register {
foo(): any {}
}
2.or也许在Register.ts等中只有“export foo”。
export function foo: any {}
3.or一切都保存在模块注册,模块登录?
module Publics {
export module Register {
export function foo(): any {
// ...
}
}
export module Login {
export function foo(): any {
// ...
}
}
}
这是1个文件附加,与常用功能PublicCommons.ts ...
解决方案#2。不要使用关键字'module',它不是用于模块而是'namespace'。 – Paleo