當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。