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


TypeScript ember-routing.generateControllerFactory函数代码示例

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


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

示例1: createRenderState

 createRenderState(args: Arguments, owner: Owner, name: string) {
   let model = args.positional.at(1);
   let factory =
     owner.factoryFor(`controller:${name}`) ||
     generateControllerFactory(owner, `controller:${name}`);
   let controller = factory.create({ model: model.value() });
   return { controller, model };
 }
开发者ID:realityendshere,项目名称:ember.js,代码行数:8,代码来源:render.ts

示例2: getSelf

  getSelf(bucket: EngineBucket): VersionedPathReference<Opaque> {
    let { engine, modelReference } = bucket;

    let applicationFactory = engine.factoryFor(`controller:application`);
    let controllerFactory = applicationFactory || generateControllerFactory(engine, 'application');
    let controller = bucket.controller = controllerFactory.create();

    if (EMBER_ENGINES_MOUNT_PARAMS) {
      let model = modelReference.value();
      bucket.modelRevision = modelReference.tag.value();
      controller.set('model', model);
    }

    return new RootReference(controller);
  }
开发者ID:fpauser,项目名称:ember.js,代码行数:15,代码来源:mount.ts

示例3: create

  create(environment: Environment, definition: RenderDefinition, args: IArguments, dynamicScope: DynamicScope) {
    let { name, env } = definition;
    let modelRef = args.positional.at(0);
    let controllerFactory = env.owner.factoryFor(`controller:${name}`);

    let factory: any = controllerFactory || generateControllerFactory(env.owner, name);
    let controller = factory.create({ model: modelRef.value() });

    if (DEBUG) {
      this._pushToDebugStack(`controller:${name} (with the render helper)`, environment);
    }

    if (dynamicScope.rootOutletState) {
      dynamicScope.outletState = dynamicScope.rootOutletState.getOrphan(name);
    }

    return { controller, model: modelRef };
  }
开发者ID:fpauser,项目名称:ember.js,代码行数:18,代码来源:render.ts


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