本文整理匯總了TypeScript中@uirouter/core.StateService.go方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StateService.go方法的具體用法?TypeScript StateService.go怎麽用?TypeScript StateService.go使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@uirouter/core.StateService
的用法示例。
在下文中一共展示了StateService.go方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.newPage = (type: string) => {
if (this.apiId) {
$state.go('management.apis.detail.portal.newdocumentation', {type: type, parent: this.rootDir});
} else {
$state.go('management.settings.newdocumentation', {type: type, parent: this.rootDir});
}
};
示例2:
this.gotoParent = () => {
if (this.apiId) {
$state.go("management.apis.detail.portal.documentation", {apiId: this.apiId, parent: $state.params.parent});
} else {
$state.go("management.settings.documentation", {parent: $state.params.parent});
}
};
示例3:
this.reset = () => {
if (this.apiId) {
$state.go("management.apis.detail.portal.editdocumentation", {pageId: this.page.id}, {reload: true});
} else {
$state.go("management.settings.editdocumentation", {pageId: this.page.id}, {reload: true});
}
};
示例4:
this.cancel = () => {
if (this.apiId) {
$state.go("management.apis.detail.portal.documentation", {apiId: this.apiId});
} else {
$state.go("management.settings.documentation");
}
};
示例5:
this.UserService.current().then( (user) => {
if (provider.userLogoutEndpoint) {
this.$window.localStorage.setItem("user-logout-url", provider.userLogoutEndpoint);
}
this.$rootScope.$broadcast('graviteeUserRefresh', {'user' : user});
let route = this.RouterService.getLastRoute();
if (route.from && route.from.name !== '' && route.from.name !== 'logout' && route.from.name !== 'confirm') {
this.$state.go(route.from.name, route.fromParams);
} else {
this.$state.go('portal.home');
}
});