-->

什么是类名的定义中的尖括号的目的是什么?(What is the purpose of classn

2019-10-21 03:50发布

在这里另外一个问题上堆栈溢出( 这个 )我看到这一段代码:

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>的组件定义之前的标签? 你能指出我的任何文档?

Answer 1:

这是一个打字稿构建泛型,请参阅: http://www.typescriptlang.org/Handbook

以指示对象数的类型,他们使用:

var square = <Square>{};


文章来源: What is the purpose of classnames in angle brackets in definitions?