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


TypeScript ILocationService.search方法代码示例

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


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

示例1: if

 this.$timeout(() => {
   const params = this.$location.search();
   if (interval) {
     params.refresh = interval;
     this.$location.search(params);
   } else if (params.refresh) {
     delete params.refresh;
     this.$location.search(params);
   }
 });
开发者ID:grafana,项目名称:grafana,代码行数:10,代码来源:TimeSrv.ts

示例2: updateLocation

 this.$rootScope.$on('$routeChangeSuccess', (evt, data) => {
   store.dispatch(
     updateLocation({
       path: this.$location.path(),
       query: this.$location.search(),
       routeParams: this.$route.current.params,
     })
   );
 });
开发者ID:grafana,项目名称:grafana,代码行数:9,代码来源:bridge_srv.ts

示例3: setTime

  setTime(time: RawTimeRange, fromRouteUpdate?: boolean) {
    _.extend(this.time, time);

    // disable refresh if zoom in or zoom out
    if (isDateTime(time.to)) {
      this.oldRefresh = this.dashboard.refresh || this.oldRefresh;
      this.setAutoRefresh(false);
    } else if (this.oldRefresh && this.oldRefresh !== this.dashboard.refresh) {
      this.setAutoRefresh(this.oldRefresh);
      this.oldRefresh = null;
    }

    // update url
    if (fromRouteUpdate !== true) {
      const urlRange = this.timeRangeForUrl();
      const urlParams = this.$location.search();
      urlParams.from = urlRange.from;
      urlParams.to = urlRange.to;
      this.$location.search(urlParams);
    }

    this.$timeout(this.refreshDashboard.bind(this), 0);
  }
开发者ID:grafana,项目名称:grafana,代码行数:23,代码来源:TimeSrv.ts

示例4: routeUpdated

 private routeUpdated() {
   const params = this.$location.search();
   const urlRange = this.timeRangeForUrl();
   // check if url has time range
   if (params.from && params.to) {
     // is it different from what our current time range?
     if (params.from !== urlRange.from || params.to !== urlRange.to) {
       // issue update
       this.initTimeFromUrl();
       this.setTime(this.time, true);
     }
   } else if (this.timeHasChangedSinceLoad()) {
     this.setTime(this.timeAtLoad, true);
   }
 }
开发者ID:grafana,项目名称:grafana,代码行数:15,代码来源:TimeSrv.ts

示例5: initTimeFromUrl

 private initTimeFromUrl() {
   const params = this.$location.search();
   if (params.from) {
     this.time.from = this.parseUrlParam(params.from) || this.time.from;
   }
   if (params.to) {
     this.time.to = this.parseUrlParam(params.to) || this.time.to;
   }
   // if absolute ignore refresh option saved to dashboard
   if (params.to && params.to.indexOf('now') === -1) {
     this.refresh = false;
     this.dashboard.refresh = false;
   }
   // but if refresh explicitly set then use that
   if (params.refresh) {
     this.refresh = params.refresh || this.refresh;
   }
 }
开发者ID:grafana,项目名称:grafana,代码行数:18,代码来源:TimeSrv.ts


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