本文整理汇总了TypeScript中@uirouter/core.StateService.transitionTo方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StateService.transitionTo方法的具体用法?TypeScript StateService.transitionTo怎么用?TypeScript StateService.transitionTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@uirouter/core.StateService
的用法示例。
在下文中一共展示了StateService.transitionTo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this.selectTab = (idx: number) => {
this.selectedTab = idx;
this.currentTab = this.tabs[this.selectedTab];
if (this.apiId) {
$state.transitionTo("management.apis.detail.portal.editdocumentation", {apiId: this.apiId, pageId: this.page.id, tab: this.currentTab}, {notify: false});
} else {
$state.transitionTo("management.settings.editdocumentation", {pageId: this.page.id, tab: this.currentTab}, {notify: false});
}
};
示例2: updateTimeframe
updateTimeframe(timeframeId) {
if (timeframeId) {
this.$state.transitionTo(
this.$state.current,
_.merge(this.$state.params, {
timestamp: '',
timeframe: timeframeId
}),
{notify: false});
this.setTimeframe(timeframeId, true);
}
}
示例3: createAndSendQuery
createAndSendQuery(silent) {
// Create a query with all the current filters
let query = _.values(_.mapValues(this.fields, function(value) { return value.query; })).join(' AND ');
// Update the query parameter
if (!silent) {
this.$state.transitionTo(
this.$state.current,
_.merge(this.$state.params, {
q: query
}),
{notify: false});
this.onFilterChange({query: query, widget: this.lastSource});
}
}
示例4: changeFilter
changeFilter(statusFilter) {
this.selectedStatus = statusFilter;
this.dndEnabled = (statusFilter === 'published') && this.UserService.isUserHasPermissions(['api-plan-u']);
if (_.includes(this.selectedStatus, statusFilter)) {
_.pull(this.selectedStatus, statusFilter);
} else {
this.selectedStatus.push(statusFilter);
}
this.$state.transitionTo(
this.$state.current,
_.merge(this.$state.params, {
state: statusFilter
}));
this.applyFilters();
}
示例5: update
update(timeframeParam) {
let that = this;
let timeframe = {
interval: parseInt(timeframeParam.interval),
from: parseInt(timeframeParam.from),
to: parseInt(timeframeParam.to)
};
// Select the best timeframe
let diff = timeframe.to - timeframe.from;
let tf = _.findLast(that.timeframes, function (tframe: Timeframe) {
return tframe.range <= diff;
});
this.timeframe = tf ? tf : that.timeframes[0];
// timeframeChange event is dynamically initialized, so we have to define a timeout to correctly fired it
this.$timeout(function () {
let event = {
interval: that.timeframe.interval,
from: timeframe.from,
to: timeframe.to
};
that.onTimeframeChange({timeframe: event});
}, 200);
this.current = {
interval: this.timeframe.interval,
intervalLabel: moment.duration(this.timeframe.interval).humanize(),
from: timeframe.from,
to: timeframe.to
};
this.$state.transitionTo(
this.$state.current, _.merge(this.$state.params, this.current));
this.pickerStartDate = moment(timeframe.from);
this.pickerEndDate = moment(timeframe.to);
}
示例6: viewLogs
viewLogs() {
// Update the query parameter
this.$state.transitionTo(
'management.apis.detail.analytics.logs',
this.$state.params);
}
示例7:
$timeout(function () {
$state.params.notificationId = vm.selectedNotificationSetting.id;
$state.transitionTo($state.current, $state.params);
});