• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

TypeScript aurelia-testing.StageComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: beforeEach

  beforeEach(done => {
    let container = new Container();
    viewSlot = new ViewSlotMock();
    viewFactory = new BoundViewFactoryMock();
    observerLocator = container.get(ObserverLocator);
    repeatStrategyLocator = container.get(RepeatStrategyLocator);
    repeatStrategyMock = new RepeatStrategyMock();
    container.registerInstance(TargetInstruction, instructionMock);
    container.registerInstance(ViewResources, viewResourcesMock);
    container.registerInstance(ViewSlot, viewSlot);
    container.registerInstance(BoundViewFactory, viewFactory);

    component = StageComponent.withResources().inView('<div repeat.for="item of items"></div>').boundTo({ items: [] });

    component.create(bootstrap).then(() => {
      repeat = component.viewModel;
      repeat.viewSlot = viewSlot;
      repeat.instruction = instructionMock;
      repeat.viewFactory = viewFactory;
      repeat.observerLocator = observerLocator;
      repeat.strategyLocator = repeatStrategyLocator;
      done();
    });

  });
开发者ID:aurelia,项目名称:templating-resources,代码行数:25,代码来源:repeat.spec.ts


示例2: beforeEach

 beforeEach(() => {
   viewModel = new ViewModel();
   component = StageComponent
     .withResources('dist/test/src/attach-focus')
     .boundTo(viewModel);
   component.bootstrap((aurelia: Aurelia) => aurelia.use.basicConfiguration());
 });
开发者ID:HIRANO-Satoshi,项目名称:dialog,代码行数:7,代码来源:attach-focus.spec.ts


示例3: beforeEach

 beforeEach(() => {
     sut = StageComponent
             .withResources("./../../../../base/dist/amd/javascript/media/sliderElement")
             .inView("<m:slider id='someId'></m:slider>");
     options = {
         full_width: false,
     };
 });
开发者ID:eriklieben,项目名称:aurelia-materialize-css,代码行数:8,代码来源:sliderElement.spec.ts


示例4: beforeEach

 beforeEach(() => {
     sut = StageComponent
             .withResources("./../../../../base/dist/amd/javascript/pushpin/pushpinAttribute")
             .inView("<div m:pushpin></div>");
     
     defaultOptions = {
         bottom: Infinity,
         offset: 0,
         top: 0,
     };
 });
开发者ID:eriklieben,项目名称:aurelia-materialize-css,代码行数:11,代码来源:pushpinAttribute.spec.ts


示例5: it

  it('should use route as primary property', done => {
    component = StageComponent
      .withResources(PLATFORM.moduleName('src/route-href'))
      .inView('<a route-href.bind="name"></a>')
      .boundTo({ name: 'b' });

    configure(component);

    component.create(bootstrap)
      .then(() => {
        expect(component.viewModel.route).toBe('b');
        done();
      });
  });
开发者ID:aurelia,项目名称:templating-router,代码行数:14,代码来源:route-href.spec.ts


示例6: beforeEach

 beforeEach(() => {
     sut = StageComponent
             .withResources("./../../../../base/dist/amd/javascript/dropdown/dropdownElement")
             .inView("<m:dropdown id='someId'></m:dropdown>");
     defaultOptions = {
         alignment: "left",
         belowOrigin: false,
         constrain_width: true,
         gutter: 0,
         hover: false,
         inDuration: 300,
         outDuration: 225,
     };
 });
开发者ID:eriklieben,项目名称:aurelia-materialize-css,代码行数:14,代码来源:dropdownElement.spec.ts


示例7: withNamedViewport

function withNamedViewport(routeConfig?: Partial<RouteConfig>) {
  const component = StageComponent
      .withResources()
      .inView('<router-view name="viewport1"></router-view>');

  configure(component, {
    route: ['', 'default'],
    viewPorts: {
      viewport1: { moduleId: 'test/routes/route-1' }
    },
    activationStrategy: 'replace'
  }, routeConfig);

  return component;
}
开发者ID:aurelia,项目名称:templating-router,代码行数:15,代码来源:router-view.spec.ts


示例8: configure

  const stageTest = (validationErrors: string, supplyControllerToViewModel?: boolean) => {
    const form: string = `
      <template>
        <form novalidate autocomplete='off' ${validationErrors}>
          <input ref='standardInput' type='text' value.bind='standardProp & validateOnBlur'>
        </form>
      </template>`;

    parentViewModel.form = form;

    component = StageComponent
      .withResources()
      // tslint:disable-next-line:max-line-length
      .inView(`<compose containerless view-model="./dist/test/test/resources/validation-errors-form-one" model.bind="{ form: form, controller: controller }"></compose>`)
      // tslint:enable-next-line:max-line-length
      .boundTo(parentViewModel);

    const myConfigure = (aurelia: Aurelia) => {
      const config = configure(aurelia);
      container = aurelia.container;
      return config;
    };

    component.bootstrap(myConfigure);

    /*
      at this point validation plugin has not yet been initialized, not until in component.create()
    */
    if (supplyControllerToViewModel) {
      /*
        the viewmodel is going to call this in created().
        at that point the validation plugin will have been initialized and bind() will
        not yet have been executed.
      */
      parentViewModel.controller = () => {
        const factory = container.get(ValidationControllerFactory);
        const controller = factory.createForCurrentScope();
        parentViewModel.theController = controller;
        return controller;
      };
    }

    return component.create(bootstrap as any)
      .then(() => {
        // we get here after the viewmodel's bind().
        viewModel = component.viewModel.currentViewModel;
      });
  };
开发者ID:doktordirk,项目名称:validation,代码行数:48,代码来源:validation-errors-custom-attribute.ts


示例9: withDefaultViewport

function withDefaultViewport(routeConfig?: Partial<RouteConfig>) {
  const component = StageComponent
      .withResources()
      .inView('<router-view></router-view>');

  configure(
    component,
    /*default route*/{
      route: ['', 'default'],
      moduleId: 'test/routes/route-1',
      activationStrategy: 'replace'
    },
    /*extra route config */routeConfig
  );

  return component;
}
开发者ID:aurelia,项目名称:templating-router,代码行数:17,代码来源:router-view.spec.ts


示例10: beforeEach

 beforeEach(() => {
   component = StageComponent
     .withResources('resources/elements/droid-infotile')
     .inView('<droid-infotile droid.bind="droid"></droid-infotile>')
     .boundTo({
       droid: {
         id: 0,
         armaments: ["DAS-430 Neural Inhibitor", "Heavy pulse cannon", "Poison darts", "Toxic gas dispensers"],
         creditBalance: 4611686018427388000,
         entryDate: "2016-10-08T13:12:09.4251166Z",
         equipment: [],
         height: 1.96,
         imperialContractId: "0b450fdd-f484-423b-8685-4193e9fa583d",
         name: "IG-88",
         productSeries: "IG-86"
       }
     });
 });
开发者ID:mobilemancer,项目名称:DroidWorx-Aurelia-dotNETCore,代码行数:18,代码来源:droid-infotile.spec.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript aurelia-validatejs.ValidationRules类代码示例发布时间:2022-05-25
下一篇:
TypeScript aurelia-testing.ComponentTester类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap