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


TypeScript aurelia-framework.Container类代码示例

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


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

示例1: beforeEach

  beforeEach(() => {
    container = new Container();
    sut = container.get(ExitProcedure);

    SESSION.getEnv = () => 'production';
    spyOn(OS, 'kill');
  });
开发者ID:Thanood,项目名称:monterey,代码行数:7,代码来源:exit-procedure.spec.ts

示例2: beforeEach

 beforeEach(() => {
   container = new Container();
   this.selectedProject = {};
   this.dialogController = { ok: jasmine.createSpy('dialog controller ok()') };
   container.registerInstance(SelectedProject, this.selectedProject);
   container.registerInstance(DialogController, this.dialogController);
   sut = container.get(RenameModal);
 });
开发者ID:Thanood,项目名称:monterey,代码行数:8,代码来源:rename-modal.spec.ts

示例3: beforeEach

  beforeEach(() => {
    let container = new Container();
    container.registerInstance(ValidationController, { validate: () => [] });
    container.registerInstance(GithubAPI, { getContents: async () => { return { status: 404 }; } });

    sut = container.get(UrlInput);
    sut.state = {
      github: {}
    };
  });
开发者ID:Thanood,项目名称:monterey,代码行数:10,代码来源:url-input.spec.ts

示例4: beforeEach

    beforeEach(() => {
        let container = new Container();

        router = container.get(Router);
        routerConfig = container.get(RouterConfiguration);

        spyOn(routerConfig, 'map');

        app = new App();
    });
开发者ID:bfil,项目名称:exar-db,代码行数:10,代码来源:app.spec.ts

示例5: beforeEach

 beforeEach(() => {
   container = new Container();
   notification = {};
   container.registerInstance(Notification, notification);
   ipcRenderer = { send: jasmine.createSpy('send'), on: (evt, callback) => _messageCallback = callback };
   ELECTRON.getIpcRenderer = () => ipcRenderer;
   sut = new IPC({
     container: container
   });
 });
开发者ID:Thanood,项目名称:monterey,代码行数:10,代码来源:ipc.spec.ts

示例6: beforeEach

 beforeEach(() => {
   container = new Container();
   logger = {
     error: jasmine.createSpy('logger.error'),
     info: jasmine.createSpy('logger.info'),
     warn: jasmine.createSpy('logger.warn'),
     success: jasmine.createSpy('logger.success')
   };
   LogManager.getLogger = () => logger;
   sut = container.get(Notification);
 });
开发者ID:Thanood,项目名称:monterey,代码行数:11,代码来源:notification.spec.ts

示例7: it

 it('creates real', () => {
   const container = new Container();
   routeLoader = container.get(TemplatingRouteLoader);
   const router = new Router(container, new History() as any);
   const childContainer = routeLoader.createChildContainer(router);
   const childRouter = childContainer.getChildRouter!();
   childRouter.parent = null;
   const resolver = childContainer.getResolver(Router);
   expect(resolver.strategy).toBe(3);
   expect(childContainer.hasResolver(Router));
   expect(childContainer.get(Router)).toBe(childRouter);
 });
开发者ID:aurelia,项目名称:templating-router,代码行数:12,代码来源:route-loader.unit.spec.ts

示例8:

 driverCreators.forEach((driverCreatorClass, propertyName) => {
   let driverCreatorInstance: DriverCreator = diContainer.get(driverCreatorClass)
   const { driverCreator, dispose } = driverCreatorInstance.makeDriver(context, propertyName, changes$)
   drivers[`${propertyName}$`] = driverCreator
   
   disposeMethods.add(dispose)
 })
开发者ID:niieani,项目名称:aurelia-cycle,代码行数:7,代码来源:index.ts

示例9: beforeEach

 beforeEach(() => {
   container = new Container();
   settings = container.get(Settings);
   ELECTRON.getPath = (p: string) => {
     if (p === 'userData') return 'c:/appdata/monterey';
   };
   FS.join = (...args) => Array.prototype.slice.call(args).join('/');
   FS.access = (p: any, x: any) => Promise.resolve(true);
   FS.getConstants = () => {
     return {
       W_OK: true,
       R_OK: true
     };
   };
   sut = container.get(FileSystemLogger);
 });
开发者ID:Thanood,项目名称:monterey,代码行数:16,代码来源:file-system-logger.spec.ts

示例10: wait

    it('handles attribute changed when attached to custom element', async () => {
      const hrefValue = 'AASSSBBBVCVVCC';
      const controller = {
        viewModel: {} as any
      };
      container.registerInstance(Router, {
        ensureConfigured: () => {
          return Promise.resolve();
        },
        generate: () => hrefValue
      });
      container.registerInstance(Element, element = document.createElement('div'));
      routeHref = container.get(RouteHref);
      routeHref.isActive = true;
      (element as any).au = { 'route-href': routeHref, controller };

      const spy = spyOn(RouteHref.prototype, 'processChange').and.callThrough();
      expect(routeHref.attribute).toBe('href');
      routeHref.attributeChanged('href', 'href');
      expect(spy).toHaveBeenCalledTimes(1);
      await wait(100);
      expect(routeHref.isActive).toBe(true);
      expect(controller.viewModel.href).toBe(hrefValue);

      routeHref.attribute = 'link';
      routeHref.attributeChanged('link', 'href');
      expect(element.getAttribute('href')).toBe(null);
      expect(spy).toHaveBeenCalledTimes(2);
      await wait(100);
      expect(controller.viewModel.link).toBe(hrefValue);
    });
开发者ID:aurelia,项目名称:templating-router,代码行数:31,代码来源:route-href.unit.spec.ts


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