玩转TypeScript(1) --定义简单的类
相对于JavaScript来说,TypeScript增强了强制类型,同时添加了一系列的面向对象的特性,包含:静态类型(Static typing)、类(Classes)、接口(Interfaces)、模块(Modules),它只是一门设计时语言,也就是说在运行时依然是JavaScript引擎,TypeScript只是确保在设计时可以具有现代面向对象的语言的功能。
通过一个示例来看一下在TypeScript中定义类和静态方法,以WisOne IDE为例,打开WisOne IDE,在窗口上拖一个Button按钮。单击左侧项目视图的“Design“面板,在属性面板中更改其name属性为btnButton,Caption属性值为“显示当前日期“,再拖一个TEdit控件,设置其Name属性为EdtDate,Text属性为空。双击按钮进入到代码编辑器,在编辑器中可以看到Form本身是做为一个类存在,为了演示类的创建,这里在unit1下面新建了一个示例类,如下代码所示:
module Unit1{
//创建一个新的类
export class MyFirstClass{
//定义一个静态的方法用来显示日期
static DisplayDate(edit1:Core.StdCtrls.TEdit):void{
//实例化日期类型
var currentDate:Date=new Date();
//显示当前日期字符串
edit1.text=currentDate.toLocaleDateString();
}
} export class TForm1 extends Core.Forms.TForm{
btnDate: Core.StdCtrls.TButton;
edtDate: Core.StdCtrls.TEdit; btnDateClick(sender: Core.Classes.TComponent){
//调用模块Unit1下的MyFirstClass下的静态方法DisplayDate显示日期
Unit1.MyFirstClass.DisplayDate(this.edtDate);
} }
}
TypeScript中有static关键字表明方法是一个静态方法,也就是说DisplayDate可以不用使用new进行实例化就能直接调用熟悉C#语言的会很熟悉这样的语法,在名为Unit1的Module下面,WisOne IDE自动生成了一个名为TForm1的类,我在这里定义了一个名为MyFirstClass的类,也就是说现在有2个类在Module下面,在btnDate的单击事件处理代码中,通过调用MyFirstClass类中的静态方法,就显示了当前的日期。在WisOne IDE中的运行效果如下图所示:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqgAAAG4CAIAAAAG5IINAAAXTklEQVR4nO3d+XPUhf3H8f0r/A/88VuZTr/zNX5x+m3H8HWsaRhHylEPIBAtgmi4apAr3HhR8Wy0Vv06WmoP56u1plVRBK2KB4b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rcvgfeXAVAAQUMfyrltcO9bdZAGBorFpeW8SknrsVM/xmZmZW4hN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQBN+MzOzQPt/Osxds+KdPywAAAAASUVORK5CYII=" alt="" width="600" height="363" />
Module、Class以及static这些显示的面向对象的关键字,让TypeScript的代码更加简洁,容易架构。而且对类型的支持这足以让代码容易给别人接手,在我看来,确实是让人心动。
有兴趣的朋友可以进入http://www.wisone.com/ide试着玩一下这个简单的类代码。
玩转TypeScript(1) --定义简单的类的更多相关文章
- JAVA基础学习之路(四)定义简单java类
简单java类开发一般原则: 类名称必须有意义,再怎么说,要让人家看的明白吧 类之中所有属性必须使用private封装,并提供setter,getter方法 类之中可以有多个构造方法,但是必须保留有一 ...
- 玩转TypeScript(引言&文章目录) --初看TypeScript.
JavaScript过去一直被当作一种玩具语言存在,直到2005年以后,这门语言又开始活跃并可以说是火爆,而且随着浏览器版本的不断升级和完善,各种DOM之间的兼容性已经渐渐的被各种技术解决了,比如经典 ...
- 玩转TypeScript(2) --简单TypeScript类型
通过TypeScript的Module和Class,TypeScript提供了相对于javaScript更加清晰的代码构造,相较于javaScript的.js满天飞的代码,用TypeScript,你可 ...
- 关于typescript之定义变量和数据类型那点事
变量和数据类型 JavaScript虽说深受万千程序员喜爱,却有着对于企业大规模开发很难管理的缺陷.这时候,TypeScript的优势便体现出来.接下来,我们会先接触在TypeScript中定义变量相 ...
- CesiumJS新增官方TypeScript类型定义
Cesium中文网:http://cesiumcn.org/ | 国内快速访问:http://cesium.coinidea.com/ 在当前的1.70版本中,CesiumJS现在附带了正式的Type ...
- Map中如何把没有定义操作符<的类作为key
Map中如何把没有定义操作符<的类作为key 其实,为了实现快速查找,map内部本身就是按序存储的(比如红黑树).在我们插入<key, value>键值对时,就会按照key的大小顺序 ...
- hadoop编程小技巧(5)---自己定义输入文件格式类InputFormat
Hadoop代码測试环境:Hadoop2.4 应用:在对数据须要进行一定条件的过滤和简单处理的时候能够使用自己定义输入文件格式类. Hadoop内置的输入文件格式类有: 1)FileInputForm ...
- 简单Java类 全网最详细讲解 !!!
最近学习java非常吃力,学习的进度很快,由于基础没打牢固,整体上项目理解很吃力,偶尔会遇到一些基本的概念,都会阻碍整体的理解.最近也看了不少的视频讲解,听得很迷,最后搞得很乱,没有明确的学习目标,今 ...
- C++:如何正确的定义一个接口类
C++中如何定义接口类?首先给接口类下了定义:接口类应该是只提供方法声明,而自身不提供方法定义的抽象类.接口类自身不能实例化,接口类的方法定义/实现只能由接口类的子类来完成. 而对于C++,其接口类一 ...
随机推荐
- WPF基础学习笔记整理 (七) Binding绑定
基础知识: 数据绑定是一种关系,该关系告诉WPF从源对象提取一些信息,并用这些信息设置目标对象的属性:目标对象始终是依赖属性,而源对象则可以是任何内容. BindingOperations类,提供静态 ...
- jq 便捷api jq 常用 api jq 快捷 api
jq 选择器 1.相对值用法 width("+=250px") $("input").width("+=250px"); 2.使用函数来 ...
- json 与 string 互转
1. json字符串转换成json对象 js: JSON.parse('{"age":"28"}') eval('(' + '{"age": ...
- Codeforces 595B - Pasha and Phone
595B - Pasha and Phone 代码: #include<bits/stdc++.h> using namespace std; #define ll long long # ...
- React生命周期钩子
最近的工作都很忙,所以很少完整的时间可以用来总结和回顾知识点,今天就趁着是周末,我准备在这里复习和回顾一下React的基础.工作中主要用的vue比较多,在工作中使用React也已经是一年前了,当时用的 ...
- domContentload和onload
defer和async <script src="script.js"></script> 没有 defer 或 async,浏览器会立即加载并执行指定的脚 ...
- spring boot: thymeleaf模板引擎使用
spring boot: thymeleaf模板引擎使用 在pom.xml加入thymeleaf模板依赖 <!-- 添加thymeleaf的依赖 --> <dependency> ...
- 雷林鹏分享:Ruby 字符串(String)
Ruby 字符串(String) Ruby 中的 String 对象存储并操作一个或多个字节的任意序列,通常表示那些代表人类语言的字符. 最简单的字符串是括在单引号(单引号字符)内.在引号标记内的文本 ...
- LeetCode--217--存在重复元素
问题描述: 给定一个整数数组,判断是否存在重复元素. 如果任何值在数组中出现至少两次,函数返回 true.如果数组中每个元素都不相同,则返回 false. 示例 1: 输入: [1,2,3,1] 输出 ...
- poj 1182 (带权并查集)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 71361 Accepted: 21131 Description ...