本文整理汇总了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');
});