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

TypeScript angular.ITimeoutService类代码示例

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

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



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

示例1: it

    it('polls until the execution matches, then resolves', () => {
      const executionId = 'abc';
      const url = [SETTINGS.gateUrl, 'pipelines', executionId].join('/');
      let succeeded = false;

      $httpBackend.expectGET(url).respond(200, { thingToMatch: false });

      executionService.waitUntilExecutionMatches(executionId, (execution) => (execution as any).thingToMatch)
        .then(() => succeeded = true);

      expect(succeeded).toBe(false);

      $httpBackend.flush();
      expect(succeeded).toBe(false);

      // no match, retrying
      $httpBackend.expectGET(url).respond(200, { thingToMatch: false });
      timeout.flush();
      $httpBackend.flush();

      expect(succeeded).toBe(false);

      // still no match, retrying again
      $httpBackend.expectGET(url).respond(200, { thingToMatch: true });
      timeout.flush();
      $httpBackend.flush();

      expect(succeeded).toBe(true);
    });
开发者ID:robfletcher,项目名称:deck,代码行数:29,代码来源:execution.service.spec.ts


示例2: it

    it('limits executions per pipeline', function () {
      const application: Application = modelBuilder.createApplication({key: 'executions', lazy: true}, {key: 'pipelineConfigs', lazy: true});
      application.getDataSource('executions').data = [
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 1, stages: [] },
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 2, stages: [] },
        { pipelineConfigId: '1', name: 'pipeline 1', endTime: 3, stages: [] },
        { pipelineConfigId: '2', name: 'pipeline 2', endTime: 1, stages: [] },
      ];
      application.getDataSource('pipelineConfigs').data = [
        { name: 'pipeline 1', pipelineConfigId: '1' },
        { name: 'pipeline 2', pipelineConfigId: '2' },
      ];

      model.sortFilter.count = 2;
      model.sortFilter.groupBy = 'none';

      service.updateExecutionGroups(application);
      $timeout.flush();

      expect(model.groups.length).toBe(1);
      expect(model.groups[0].executions.length).toBe(3);
      expect(model.groups[0].executions.filter((ex: IExecution) => ex.pipelineConfigId === '1').length).toBe(2);
      expect(model.groups[0].executions.filter((ex: IExecution) => ex.pipelineConfigId === '2').length).toBe(1);

      model.sortFilter.groupBy = 'name';
      service.updateExecutionGroups(application);
      $timeout.flush();

      expect(model.groups.length).toBe(2);
      expect(model.groups[0].executions.length).toBe(2);
      expect(model.groups[1].executions.length).toBe(1);

    });
开发者ID:brujoand,项目名称:deck,代码行数:33,代码来源:executionFilter.service.spec.ts


示例3: function

      let displayTooltip = function (newValue, showDelayed?) {
        if (showTooltipPromise) {
          $timeout.cancel(showTooltipPromise)
        }

        let taskTooltips = $scope.task.model.tooltips
        let rowTooltips = $scope.task.row.model.tooltips

        if (typeof(taskTooltips) === 'boolean') {
          taskTooltips = {enabled: taskTooltips}
        }

        if (typeof(rowTooltips) === 'boolean') {
          rowTooltips = {enabled: rowTooltips}
        }

        let enabled = ganttUtils.firstProperty([taskTooltips, rowTooltips], 'enabled', $scope.pluginScope.enabled)
        if (enabled && !visible && mouseEnterX !== undefined && newValue) {
          let content = ganttUtils.firstProperty([taskTooltips, rowTooltips], 'content', $scope.pluginScope.content)
          $scope.content = content

          if (showDelayed) {
            showTooltipPromise = $timeout(function () {
              showTooltip(mouseEnterX)
            }, $scope.pluginScope.delay, false)
          } else {
            showTooltip(mouseEnterX)
          }
        } else if (!newValue) {
          if (!$scope.task.active) {
            hideTooltip()
          }
        }
      }
开发者ID:angular-gantt,项目名称:angular-gantt,代码行数:34,代码来源:tooltip.directive.ts


示例4: ganttDebounce

    $element.bind('scroll', ganttDebounce(function () {
      let el = $element[0]
      let currentScrollLeft = el.scrollLeft
      let direction
      let date

      $scope.gantt.scroll.cachedScrollLeft = currentScrollLeft
      $scope.gantt.columnsManager.updateVisibleColumns()
      $scope.gantt.rowsManager.updateVisibleObjects()

      if (currentScrollLeft < lastScrollLeft && currentScrollLeft === 0) {
        direction = 'left'
        date = $scope.gantt.columnsManager.from
      } else if (currentScrollLeft > lastScrollLeft && el.offsetWidth + currentScrollLeft >= el.scrollWidth - 1) {
        direction = 'right'
        date = $scope.gantt.columnsManager.to
      }

      lastScrollLeft = currentScrollLeft

      if (date !== undefined) {
        if (autoExpandTimer) {
          $timeout.cancel(autoExpandTimer)
        }

        autoExpandTimer = $timeout(function () {
          autoExpandColumns(el, date, direction)
        }, 300)
      } else {
        $scope.gantt.api.scroll.raise.scroll(currentScrollLeft)
      }
    }, 5))
开发者ID:angular-gantt,项目名称:angular-gantt,代码行数:32,代码来源:scrollable.directive.ts


示例5: it

    it('should wait until task is gone, then resolve', () => {
      const taskId = 'abc';
      const deleteUrl = [API.baseUrl, 'tasks', taskId].join('/');
      const checkUrl = [API.baseUrl, 'tasks', taskId].join('/');
      let completed = false;

      $httpBackend.expectDELETE(deleteUrl).respond(200, []);

      taskWriter.deleteTask(taskId).then(() => completed = true);

      // first check: task is still present
      $httpBackend.expectGET(checkUrl).respond(200, [{id: taskId}]);
      $httpBackend.flush();
      expect(completed).toBe(false);

      // second check: task retrieval returns some error, try again
      $httpBackend.expectGET(checkUrl).respond(500, null);
      timeout.flush();
      $httpBackend.flush();
      expect(completed).toBe(false);

      // third check: task is not present, should complete
      $httpBackend.expectGET(checkUrl).respond(404, null);
      timeout.flush();
      $httpBackend.flush();
      expect(completed).toBe(true);
    });
开发者ID:jcwest,项目名称:deck,代码行数:27,代码来源:task.write.service.spec.ts


示例6: function

    function () {
      let $scope = $rootScope.$new()

      let ganttApi
      let ready = false
      $scope.api = function (api) {
        ganttApi = api

        ganttApi.core.on.ready($scope, function () {
          ready = true
        })
      }

      $compile('<div gantt api="api"></div>')($scope)
      $scope.$digest()
      $timeout.flush()

      expect(ganttApi).to.be.not.undefined
      expect(ready).to.be.ok

      ganttApi = undefined
      ready = false

      $compile('<div gantt api="api"></div>')($scope)
      $scope.$digest()
      $timeout.flush()

      expect(ganttApi).to.be.not.undefined
      expect(ready).to.be.ok
    }
开发者ID:angular-gantt,项目名称:angular-gantt,代码行数:30,代码来源:gantt.factory.spec.ts


示例7: it

        it('should add empty option to a new arriving array', () => {
            // given
            data = [{ id: 1, title: 'A' }];
            $compile(elem)($scope);
            $scope.$digest();
            $timeout.flush();

            // when
            $scope.$column.data = () => $timeout(() => [{ id: 1, title: 'B' }], 10);
            $scope.$digest();
            $timeout.flush();

            // then
            expect($scope.$selectData).toEqual([{ id: '', title: '' }, { id: 1, title: 'B' }]);
        });
开发者ID:QuBaR,项目名称:ng-table,代码行数:15,代码来源:selectFilterDs.spec.ts


示例8: function

        function () {
          let $scope = $rootScope.$new()

          $scope.data = angular.copy(mockData)
          let ganttElement = $compile('<div gantt data="data"><gantt-tree></gantt-tree></div>')($scope)
          $scope.$digest()
          $timeout.flush()

          // Set the data in tree view ordering
          let orderedData = $scope.data.slice()
          let indices = {}

          angular.forEach($scope.data, function (rowModel, i) {
            if (rowModel.name) {
              indices[rowModel.name] = i
            }
          })

          /*jshint sub:true */
          let configRow = orderedData[indices['Config']]
          let setupRow = orderedData[indices['Setup']]
          let serverRow = orderedData[indices['Server']]

          orderedData[indices['Setup']] = serverRow
          orderedData[indices['Config']] = setupRow
          orderedData[indices['Server']] = configRow
          /*jshint sub:false */

          checkLabels(orderedData, ganttElement)
        }
开发者ID:angular-gantt,项目名称:angular-gantt,代码行数:30,代码来源:plugins.spec.ts


示例9: it

        it("should initialise and load loading page when template cache is not ready", () => {
            pageRouterService.templateLoadingState = TemplateState.NotReady;
            spyOn(pageRouterService, "getPageTitle").and.returnValue("Test Page");
            spyOn($templateCache, "get").and.callFake(page => {
                if (page === "page/testpage.html") {
                    return "<div>some template</div>";
                } else if (page === "page/disclaimmain.html") {
                    return "<div>disclaimer</div>";
                }
            });

            initController();

            expect(ctrl.pageData).toEqual([
                {PageContent: `<div id="loader"></div>`, PageTitle: "CA London"}
            ]);
            expect(ctrl.pageName).toEqual("testpage");
            expect($window.document.title).toEqual("Cocaine Anonymous London");

            pageRouterService.templateLoadingState = TemplateState.Ready;
            $timeout.flush();

            expect(ctrl.pageData).toEqual([
                {PageContent: "<div>some template</div>"},
                {PageContent: "<div>disclaimer</div>"}
            ]);
            expect(ctrl.pageName).toEqual("testpage");
            expect($window.document.title).toEqual("Test Page | Cocaine Anonymous London");
        });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:29,代码来源:page-router.controller.spec.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.IWindowService类代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.ITemplateCacheService类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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