本文整理汇总了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 };
}
示例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);
}
示例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 };
}