本文整理匯總了TypeScript中@uirouter/core.StateService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript StateService類的具體用法?TypeScript StateService怎麽用?TypeScript StateService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了StateService類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
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});
}
};
示例2:
this.cancel = () => {
if (this.apiId) {
$state.go("management.apis.detail.portal.documentation", {apiId: this.apiId});
} else {
$state.go("management.settings.documentation");
}
};
示例3:
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});
}
};
示例4:
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});
}
};
示例5: it
it("can cancel a transition that would exit the view's state by returning false", () => {
$state.defaultErrorHandler(function() {});
ctrl.prototype.uiCanExit = function() { log += "canexit;"; return false; };
initial();
$state.go('bar'); $q.flush(); $timeout.flush();
expect(log).toBe('canexit;');
expect($state.current.name).toBe('foo');
});