当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ember-metal.flaggedInstrument函数代码示例

本文整理汇总了TypeScript中ember-metal.flaggedInstrument函数的典型用法代码示例。如果您正苦于以下问题:TypeScript flaggedInstrument函数的具体用法?TypeScript flaggedInstrument怎么用?TypeScript flaggedInstrument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了flaggedInstrument函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: run

 run(() => {
   let args = this.getActionArgs();
   let payload = {
     args,
     target,
     name: null,
   };
   if (typeof actionName[INVOKE] === 'function') {
     flaggedInstrument('interaction.ember-action', payload, () => {
       actionName[INVOKE].apply(actionName, args);
     });
     return;
   }
   if (typeof actionName === 'function') {
     flaggedInstrument('interaction.ember-action', payload, () => {
       actionName.apply(target, args);
     });
     return;
   }
   payload.name = actionName;
   if (target.send) {
     flaggedInstrument('interaction.ember-action', payload, () => {
       target.send.apply(target, [actionName, ...args]);
     });
   } else {
     assert(
       `The action '${actionName}' did not exist on ${target}`,
       typeof target[actionName] === 'function',
     );
     flaggedInstrument('interaction.ember-action', payload, () => {
       target[actionName].apply(target, args);
     });
   }
 });
开发者ID:jasonmit,项目名称:ember.js,代码行数:34,代码来源:action.ts

示例2: get

    if (targetAttribute && targetAttribute !== '_self') {
      return false;
    }

    let qualifiedRouteName = get(this, 'qualifiedRouteName');
    let models = get(this, 'models');
    let queryParams = get(this, 'queryParams.values');
    let shouldReplace = get(this, 'replace');

    let payload = {
      queryParams,
      routeName: qualifiedRouteName,
    };

    // tslint:disable-next-line:max-line-length
    flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace));
    return false;
  },

  _generateTransition(payload: any, qualifiedRouteName: string, models: any[], queryParams: any[], shouldReplace: boolean) {
    let routing = get(this, '_routing');
    return () => {
      payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace);
    };
  },

  queryParams: null,

  qualifiedRouteName: computed('targetRouteName', '_routing.currentState',
  function computeLinkToComponentQualifiedRouteName(this: any) {
    let params = get(this, 'params');
开发者ID:GowthamMK,项目名称:ember.js,代码行数:31,代码来源:link-to.ts

示例3: return

 return (...args: any[]) => {
   let payload = { target: self, args, label: '@glimmer/closure-action' };
   return flaggedInstrument('interaction.ember-action', payload, () => {
     return join(self, fn, ...processArgs(args));
   });
 };
开发者ID:jrjohnson,项目名称:ember.js,代码行数:6,代码来源:action.ts


注:本文中的ember-metal.flaggedInstrument函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。