本文整理汇总了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);
}
});
示例2: updateLocation
this.$rootScope.$on('$routeChangeSuccess', (evt, data) => {
store.dispatch(
updateLocation({
path: this.$location.path(),
query: this.$location.search(),
routeParams: this.$route.current.params,
})
);
});
示例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);
}
示例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);
}
}
示例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;
}
}