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


TypeScript IRootScopeService.%24digest方法代码示例

本文整理汇总了TypeScript中angular.IRootScopeService.%24digest方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IRootScopeService.%24digest方法的具体用法?TypeScript IRootScopeService.%24digest怎么用?TypeScript IRootScopeService.%24digest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular.IRootScopeService的用法示例。


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

示例1: it

    it('resolves immediately for relative and non-http requests', function() {
      let resolved: IRequestConfig = null;
      const request: IRequestConfig = { url: '/something/relative', method: 'GET' };
      interceptor.request(request).then(function(result) { resolved = result; });
      $rootScope.$digest();
      expect(resolved.url).toBe(request.url);

      request.url = 'tcp://what.are.you.doing.here';
      interceptor.request(request).then(function(result) { resolved = result; });
      $rootScope.$digest();
      expect(resolved.url).toBe(request.url);
    });
开发者ID:brujoand,项目名称:deck,代码行数:12,代码来源:authentication.interceptor.spec.ts

示例2: it

    it('should remove all items from the specified cache', () => {
      let cache = InfrastructureCaches.get('securityGroups');
      expect(cache).toBeUndefined();

      cacheInitializer.initialize().then(() => {
        cache = InfrastructureCaches.get('securityGroups');
        expect(cache).toBeDefined();
        expect(cache.keys().length).toBe(0);

        const key = 'myTestCacheKey';
        const value = 'myTestCacheValue';
        cache.put(key, value);

        expect(cache.keys().length).toBe(1);
        expect(cache.get(key)).toBe(value);

        cacheInitializer.refreshCache('securityGroups').then((result: any[]) => {
          expect(flatten(result)).toEqual(keys.sg);
          cache = InfrastructureCaches.get('securityGroups');
          expect(cache.keys().length).toBe(0);
        });
        initialized = true;
      });
      $root.$digest();
      expect(initialized).toBeTruthy();
    });
开发者ID:emjburns,项目名称:deck,代码行数:26,代码来源:cacheInitializer.service.spec.ts

示例3: it

    it('should initialize the cache initializer with the initialization values', () => {
      cacheInitializer.initialize().then((result: any[]) => {
        expect(result.length).toBe(13); // from infrastructure cache config
        const flattened: string[][] = flatten(result); // only the arrays that actually contain data
        expect(flattened.length).toBe(4); // the four initialized string[] above used for the spyOns.

        const prefixes: string[] = ['account', 'sg', 'app', 'bm'];
        const foundKeys: IFoundKeys = {
          account: false,
          sg: false,
          app: false,
          bm: false,
        };

        // verify the contents of each array; that they match the values used for initialization
        for (let i = 0; i < 4; i++) {
          const item: string[] = flattened[i];
          for (let j = 0; j < 4; j++) {
            const prefix: string = prefixes[j];
            if (item[0].startsWith(prefix)) {
              expect(item).toEqual(keys[prefix]);
              foundKeys[prefix] = true;
            }
          }
        }

        // finally check the boolean object to confirm each key was found
        Object.keys(foundKeys).forEach((key: string) => expect(foundKeys[key]).toBeTruthy());
        initialized = true;
      });
      $root.$digest();
      expect(initialized).toBeTruthy();
    });
开发者ID:mizzy,项目名称:deck,代码行数:33,代码来源:cacheInitializer.service.spec.ts

示例4: it

    it("should POST add new meeting data", () => {
        const payload = {
            MeetingName: "The Parlour (Basement)",
            Address1: "Methodist Church",
            UserName: "Meetings_PostMeeting@test.com",
            Status: "ACTIVE",
            Area: "LONDON",
            District: "NONE",
            StartTime: "13:00:00",
            EndTime: "14:00:00",
            LongNotes: "Tube: Bond Street or Oxford Circus\nBus: Any bus along Oxford Street",
            Weekday: 3,
            ShortNotes: {
                NS: true,
                O: false,
                C: true,
                MO: true,
                HI: true
            },
            County: "London"
        };
        service.submitMeeting(payload);
        $rootScope.$digest();

        expect(dataService.getData).toHaveBeenCalledWith({
            webservice: "api/meetings",
            type: "POST",
            payload: payload
        });
    });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:30,代码来源:meeting.service.spec.ts

示例5: it

        it("should remove the auth cookie if logout page is visited", () => {
            $location.path("/page/logout");

            $rootScope.$digest();

            expect(session.removeAuthCookie).toHaveBeenCalled();
        });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:7,代码来源:load-template-cache.run.spec.ts

示例6: it

    it("should get data when getAllEvents is called for editor page", () => {
        service.getAllEvents();
        $rootScope.$digest();

        expect(dataService.getData).toHaveBeenCalledWith({
            webservice: "api/events",
            type: "GET"
        });
    });
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:9,代码来源:event.service.spec.ts


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