本文整理汇总了TypeScript中angular.ILocationService.path方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ILocationService.path方法的具体用法?TypeScript ILocationService.path怎么用?TypeScript ILocationService.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.ILocationService
的用法示例。
在下文中一共展示了ILocationService.path方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should open the servmeetingform page with correct meeting data", () => {
$location.path("/page/servmeet");
ctrl.sharedRouteParamsService.resetRouteProperties();
const testServiceMeeting: IEvent = _.clone(TestServiceMeeting);
ctrl.copyMeeting(testServiceMeeting);
expect($location.path()).toEqual("/page/servmeetform");
expect(ctrl.sharedRouteParamsService.sharedInfo).toEqual({
event: {
CAEventsID: 11,
EventNum: null,
Revision: null,
PreTitle: "London Area",
Title: "Area Service Committee Meeting",
StartDate: moment("2028-02-27 19:00:00"),
EndDate: moment("2028-02-27 21:00:00"),
Address1: "Hinde St Methodist Church",
Address2: "19 Thayer Street",
Address3: null,
City: "London",
Postcode: "W1U 2QJ",
Details: null,
FlyerName: null,
ThumbnailName: null,
TransDate: "2018-03-19T20:13:10",
UserName: "testtestcom",
EventStatus: "ACTIVE",
trustedDetails: null,
IsService: true,
IgnoreTime: false
}
});
});
示例2: it
it("should route to meetingform page", () => {
$location.path("/page/meetings");
baseMeeting.addNewMeeting();
expect($location.path()).toEqual("/page/meetingform");
});
示例3: it
it("should open the pageeditform page", () => {
$location.path("/page/pageeditor");
ctrl.sharedRouteParamsService.resetRouteProperties();
ctrl.newPage();
expect($location.path()).toEqual("/page/pageeditform");
expect(ctrl.sharedRouteParamsService.sharedInfo).toEqual({});
});
示例4: it
it("should route to meetingform page", () => {
$location.path("/page/meetingedit");
ctrl.sharedRouteParamsService.resetRouteProperties();
initController();
ctrl.editMeeting({MeetingNum: 123, Revision: 2});
expect($location.path()).toEqual("/page/meetingform");
expect(ctrl.sharedRouteParamsService.sharedInfo).toEqual({meetingNum: 123, revision: 2});
});
示例5: it
it("should show error message when response is bad", () => {
spyOn(pageEditorService, "postPage").and.callFake(() => {
const deferred: IDeferred<any> = $q.defer();
deferred.reject();
return deferred.promise;
});
ctrl.editor = TestPageWithContent;
ctrl.editor.PageContent = "<div>new content</div>";
ctrl.submit();
expect(pageEditorService.postPage).toHaveBeenCalledWith("read-andallo", 3, {
PageTitle: "...And All Other Mind Altering Substances",
PageContent: "<div>new content</div>",
Status: "ACTIVE",
ContentType: "R",
ImageFilename: "PAMPHLETS_All_Other"
});
$scope.$digest();
expect(alertModalService.show).toHaveBeenCalledWith({
style: "danger",
title: "Failed to save changes",
message: "Could not save changes due to an unknown error. Please try again later."
});
expect($location.path()).toEqual("/page/pageeditform");
});
示例6: it
it("should remove the auth cookie if logout page is visited", () => {
$location.path("/page/logout");
$rootScope.$digest();
expect(session.removeAuthCookie).toHaveBeenCalled();
});