定义中尖括号中的类名的目的是什么? [英] What is the purpose of classnames in angle brackets in definitions?

查看:128
本文介绍了定义中尖括号中的类名的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Stack Overflow的另一个问题(这一个)我看过这段代码:

In another question here on Stack Overflow (this one) I have seen this piece of code:

Ext.define("App.view.leaders.MyViewName", {
    extend: 'App.view.basePopup',
    xtype: 'MyViewName',
    config: <Ext.form.IPanel>{
        scrollable: 'vertical',           
        items: [
            {
                 xtype: 'fieldset',
                 title: 'Add New Auto Asset',
                 instructions: '<hr class="separate" />',
                 items: [
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Borrower Position',
                         store: 'BorrowerPositionSelectorStore',
                     },
                     <Ext.field.ISelect>{
                         xtype: 'selectfield',
                         label: 'Asset Type',
                         store: 'AssetTypeSelectorStore',
                     },
                     {
                         xtype: 'textfield',
                         name: '',
                         label: 'Description'
                     },
                     {
                         xtype: 'numberfield',
                         name: '',
                         label: 'Value'
                     }                               
                 ]
             }
         ]
    }
});

< Ext.form.IPanel> < Ext.form.ISelect> 标签之前的组件定义?你可以指出我的任何文档吗?

What is the purpose of the <Ext.form.IPanel>, <Ext.form.ISelect> tags before the components definitions? Can you point me to any documentation on that?

推荐答案

这是一个用于泛型的TypeScript结构,参见: http://www.typescriptlang.org/Handbook

It's a TypeScript construct for generics, see: http://www.typescriptlang.org/Handbook

要指出他们使用的对象文字的类型:

To indicate the type of the object literal, they use:

var square = <Square>{};

这篇关于定义中尖括号中的类名的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆