當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript object.setProperties函數代碼示例

本文整理匯總了TypeScript中@ember/object.setProperties函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript setProperties函數的具體用法?TypeScript setProperties怎麽用?TypeScript setProperties使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了setProperties函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: onChange

 /**
  * When user selects an item from the list
  */
 onChange(selected: string): void {
   if (selected && selected.trim().length > 0) {
     setProperties(this, {
       text: selected,
       inputText: selected
     });
     this.onSearch(selected);
   }
 }
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:12,代碼來源:search-box.ts

示例2: onFocus

 /**
  * When the input transitioned from blur->focus
  * Restore inputText value from text, open suggestions, and search latest term
  */
 onFocus(pws: IPowerSelectAPI<string>): void {
   setProperties(this, {
     inputText: this.text,
     powerSelectApi: pws
   });
   if (this.text) {
     pws.actions.search(this.text);
     pws.actions.open();
   }
 }
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:14,代碼來源:search-box.ts

示例3: async

const getBaseTest = async (test: ISearchBoxTestContext, override: ISearchBoxContract | {} = {}) => {
  const props: ISearchBoxContract = {
    placeholder: 'this is my placeholder',
    text: undefined,
    onTypeahead: async () => [],
    onSearch: () => {},
    ...override
  };

  setProperties(test, props);

  await render(hbs`
    {{#search/search-box
      placeholder=(readonly placeholder)
      text=(readonly text)
      onTypeahead=(action onTypeahead)
      onSearch=(action onSearch) as |suggestion|}}
      {{suggestion}}
    {{/search/search-box}}
  `);

  return props;
};
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:23,代碼來源:search-box-test.ts

示例4: run

 let ret = run(function() {
   return setProperties(context, hash);
 });
開發者ID:switchfly,項目名稱:ember-test-helpers,代碼行數:3,代碼來源:setup-context.ts


注:本文中的@ember/object.setProperties函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。