本文整理匯總了TypeScript中angular2-cookie/core.CookieService.putObject方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CookieService.putObject方法的具體用法?TypeScript CookieService.putObject怎麽用?TypeScript CookieService.putObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2-cookie/core.CookieService
的用法示例。
在下文中一共展示了CookieService.putObject方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(() => {
machineIdConfig = 'valid-cookie';
thisMachineConfig = Observable.of(MachineConfiguration.fromJson({'MachineId': '123'}));
cookieService = new CookieService(new CookieOptions());
cookieService.putObject('machine_config_id', '1991653a-ddb8-47fd-9d3a-86761506fa4f');
cookieService.putObject('machine_config_details', { 'KioskConfigId': 1, 'KioskIdentifier': '1991653a-ddb8-47fd-9d3a-86761506fa4f', 'KioskName': 'Test Kiosk 1 Name', 'KioskDescription': 'Test Kiosk 1 Desc', 'KioskTypeId': 1, 'LocationId': 3, 'CongregationId': 1, 'RoomId': 1984, 'StartDate': '2016-10-27T00:00:00', 'EndDate': null });
fixture = new HomeComponent(router, cookieService, setupServiceStub);
childSigninRedirectSpy = spyOn(fixture, 'goToChildSignin');
childCheckinRedirectSpy = spyOn(fixture, 'goToChildCheckin');
adminToolsRedirectSpy = spyOn(fixture, 'goToAdminTools');
setupErrorRedirectSpy = spyOn(fixture, 'goToSetupError');
});
示例2: beforeEach
beforeEach(() => {
cookieService = new CookieService(new CookieOptions());
cookieService.putObject('machine_config_id', machineIdStub);
cookieService.putObject('machine_config_details', machineConfigStub);
httpClientService = {
get(url: string) {
let response = new ResponseOptions({ body: machineConfigStub });
return Observable.throw('invalid config');
}
};
fixture = new SetupService(httpClientService, cookieService);
});
示例3:
this.userService.login(email, password).subscribe((result) => {
if (result) {
console.log(result)
this._cookieService.putObject("auth", result);
this.router.navigate(['bucketlist']);
}
});
示例4: onSubmit
onSubmit() {
this.cookieService.putObject('settings', this.settings);
window.history.back();
}
示例5: setMachineDetailsConfigCookie
setMachineDetailsConfigCookie(config: MachineConfiguration) {
this.cookieService.putObject(MachineConfiguration.COOKIE_NAME_DETAILS, config);
}
示例6: setMachineIdConfigCookie
setMachineIdConfigCookie(guid: string) {
this.cookieService.putObject(MachineConfiguration.COOKIE_NAME_ID, guid, this.persistentCookieOptions);
}
示例7:
this.newUserService.new_user(name, email, password, password_confirmation).subscribe((result) => {
console.log(result)
if (result) {
this._cookieService.putObject("auth", result);
this.router.navigate(['bucketlist']); }
});