本文整理匯總了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);
});