• ...
    2019-10-14
    命名空间
    作用
    隔离作用域,主要是兼容旧系统全局变量
    特点
      利用闭包的原理,创建了一个立即执行函数
    用法
    1.在全局环境下使用
    2.在需要引用其他变量时,而引入其他文件时,利用///加相对路径
     /// <reference path="Validation.ts" />
    3.存储命名空间变量
       export 变量=命名空间.变量
    展开
    
    
  • Geek_c4e3fd
    2019-08-22
    C#里面好像也有命名空间
    
    
  • 东丰瑞雪建华年
    2019-08-10
    测试了下,命名空间支持嵌套
    ```javascript
    /// <reference path="Validation.ts" />

    namespace Validation {
      namespace config {
        export const log:number = 1
      }
      export function testName(val: string):boolean {
        return val.length > 0 && val.length < 4
      }
    }

    ```
    展开
    
    
我们在线,来聊聊吧