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

TypeScript angular.IRootScopeService类代码示例

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

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



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

示例1: catch

  internals.$setupBreadcrumbsAutoClear = ($rootScope: IRootScopeService, $injector: any) => {
    const uiSettings = chrome.getUiSettingsClient();
    const $route = $injector.has('$route') ? $injector.get('$route') : {};

    $rootScope.$on('$routeChangeStart', () => {
      breadcrumbSetSinceRouteChange = false;
    });

    $rootScope.$on('$routeChangeSuccess', () => {
      const current = $route.current || {};

      if (breadcrumbSetSinceRouteChange || (current.$$route && current.$$route.redirectTo)) {
        return;
      }

      const k7BreadcrumbsProvider = current.k7Breadcrumbs;
      if (!k7BreadcrumbsProvider || !uiSettings.get('k7design')) {
        newPlatformChrome.setBreadcrumbs([]);
        return;
      }

      try {
        chrome.breadcrumbs.set($injector.invoke(k7BreadcrumbsProvider));
      } catch (error) {
        fatalError(error);
      }
    });
  };
开发者ID:gingerwizard,项目名称:kibana,代码行数:28,代码来源:breadcrumbs.ts


示例2: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        const $rootScope: IRootScopeService = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);
        $location = $injector.get("$location");

        sharedRouteParamsService = $injector.get("SharedRouteParamsService");
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:8,代码来源:nav-bar.controller.spec.ts


示例3: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        const $rootScope: IRootScopeService = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);

        ctrl = $controller("YearCtrl", {
            $scope: $scope
        });
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:9,代码来源:year.controller.spec.ts


示例4: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        const $rootScope: IRootScopeService = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);
        $location = $injector.get("$location");
        meetingService = $injector.get("MeetingService");
        sharedRouteParamsService = $injector.get("SharedRouteParamsService");

        sharedRouteParamsService.resetRouteProperties();

        spyOn(meetingService, "getWeekday");
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:12,代码来源:ca-meeting-panel.controller.spec.ts


示例5: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $q = $injector.get("$q");
        $location = $injector.get("$location");
        $controller = $injector.get("$controller");
        loginService = $injector.get("LoginService");
        alertModalService = $injector.get("AlertModalService");
        const $rootScope: IRootScopeService = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);

        ctrl = $controller("SignUpCtrl", {
            $scope: $scope
        });
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:13,代码来源:sign-up.controller.spec.ts


示例6: init

  init() {
    this.$rootScope.$on('$routeUpdate', (evt, data) => {
      const angularUrl = this.$location.url();
      const state = store.getState();
      if (state.location.url !== angularUrl) {
        store.dispatch(
          updateLocation({
            path: this.$location.path(),
            query: this.$location.search(),
            routeParams: this.$route.current.params,
          })
        );
      }
    });

    this.$rootScope.$on('$routeChangeSuccess', (evt, data) => {
      store.dispatch(
        updateLocation({
          path: this.$location.path(),
          query: this.$location.search(),
          routeParams: this.$route.current.params,
        })
      );
    });

    // Listen for changes in redux location -> update angular location
    store.subscribe(() => {
      const state = store.getState();
      const angularUrl = this.$location.url();
      const url = locationUtil.stripBaseFromUrl(state.location.url);
      if (angularUrl !== url) {
        this.$timeout(() => {
          this.$location.url(url);
          // some state changes should not trigger new browser history
          if (state.location.replace) {
            this.$location.replace();
          }
        });
        console.log('store updating angular $location.url', url);
      }
    });

    appEvents.on('location-change', (payload: any) => {
      const urlWithoutBase = locationUtil.stripBaseFromUrl(payload.href);
      if (this.fullPageReloadRoutes.indexOf(urlWithoutBase) > -1) {
        this.$window.location.href = payload.href;
        return;
      }

      this.$timeout(() => {
        // A hack to use timeout when we're changing things (in this case the url) from outside of Angular.
        this.$location.url(urlWithoutBase);
      });
    });
  }
开发者ID:grafana,项目名称:grafana,代码行数:55,代码来源:bridge_srv.ts


示例7: 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


示例8: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        $rootScope = $injector.get("$rootScope");
        $scope = $rootScope.$new(true);

        ctrl = $controller("CaPasswordConfirmationCtrl", {
            $scope: $scope
        });

        ctrl.passwordConfirmationForm = {
            $setPristine: () => {},
            $pristine: true,
            $dirty: false,
            $valid: true,
            $invalid: false,
            $submitted: false,
            $error: undefined,
            $name: "fakeform",
            $pending: undefined,
            $addControl: () => {},
            $removeControl: () => {},
            $setValidity: () => {},
            $setDirty: () => {},
            $commitViewValue: () => {},
            $rollbackViewValue: () => {},
            $setSubmitted: () => {},
            $setUntouched: () => {}
        };
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:29,代码来源:ca-password-confirmation.controller.spec.ts


示例9: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        $rootScope = $injector.get("$rootScope");
        $q = $injector.get("$q");
        $location = $injector.get("$location");
        $scope = $rootScope.$new(true);

        meetingService = $injector.get("MeetingService");
        sharedRouteParamsService = $injector.get("SharedRouteParamsService");
        session = $injector.get("SessionService");
        meetingPreviewModalService = $injector.get("MeetingPreviewModalService");
        alertModalService = $injector.get("AlertModalService");

        session.userName = "testusernamecom";
        session.groups = ["LitOrder"];

        districts = [
            {Area: "AREA1", AreaDescription: "Area 1 Desc", District: "DISTRICT1", DistrictDescription: "District 1 Desc"},
            {Area: "AREA2", AreaDescription: "Area 2 Desc", District: "DISTRICT2", DistrictDescription: "District 2 Desc"},
            {Area: "AREA3", AreaDescription: "Area 3 Desc", District: "DISTRICT3", DistrictDescription: "District 3 Desc"}
        ];

        spyOn(alertModalService, "show");
        spyOn($location, "path");
        spyOn(meetingService, "getDistricts").and.callFake(() => {
            const deferred: IDeferred<any> = $q.defer();
            deferred.resolve(districts);
            return deferred.promise;
        });
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:30,代码来源:meeting-form.controller.spec.ts


示例10: beforeEach

    beforeEach(angular.mock.inject($injector => {
        $controller = $injector.get("$controller");
        $rootScope = $injector.get("$rootScope");
        $q = $injector.get("$q");

        downloadsService = $injector.get("DownloadsService");

        $scope = $rootScope.$new(true);

        spyOn(downloadsService, "getDownloads").and.callFake(() => {
            const deferred: IDeferred<Array<IDownload>> = $q.defer();
            deferred.resolve(TestDownloads);
            return deferred.promise;
        });

        spyOn(downloadsService, "getCategories").and.callFake(() => {
            const deferred: IDeferred<Array<string>> = $q.defer();
            deferred.resolve(["Assembly Minutes", "ASC Minutes", "SR14"]);
            return deferred.promise;
        });

        ctrl = $controller("DownloadsCtrl", {
            $scope: $scope
        });
    }));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:25,代码来源:downloads.controller.spec.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.IScope类代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.IQService类代码示例发布时间: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