本文整理匯總了TypeScript中ngx-cookie-service.CookieService.set方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CookieService.set方法的具體用法?TypeScript CookieService.set怎麽用?TypeScript CookieService.set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ngx-cookie-service.CookieService
的用法示例。
在下文中一共展示了CookieService.set方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: navigateToEvaluation
//access the evaluation page.
navigateToEvaluation(status: string, classID: string, teacherID: string){
if (status == 'Incomplete'){
// console.log(classID+" "+teacherID);]
//push teacherid to cookie.
this.cookie.set('ESLteacherID', teacherID);
//push classid to cookie.
this.cookie.set('ESLclassID', classID);
this.router.navigateByUrl('/ESLSEOIEvaluation');
}
}
示例2: ngOnInit
ngOnInit(): void {
this.getData(this.route.snapshot.paramMap.get('id'));
this.cookieService.set( 'X-XSRF-TOKEN', this.cookieService.get('XSRF-TOKEN') );
this.formGroup.setValue({
'email': this.apartment.email
});
}
示例3: ngOnInit
ngOnInit() {
this.userToken = this.cookieService.get('userToken');
if (!this.userToken) {
this.userToken = uuid();
const date = new Date();
date.setTime(date.getTime() + (5000 * 24 * 60 * 60 * 1000));
this.cookieService.set('userToken', this.userToken, date);
}
}
示例4:
return this.sbx.login(username, password, 222).then(data => {
if (this.log) {
console.log('nope');
return false; }
if (data.success) {
this.sbx.updateCookieToken(data.token);
this.cookie.set('user_id', data.user.id);
this.log = true;
}
return data.success;
}).catch(err => {
示例5: ToggleCounty
ToggleCounty(county: string) {
var selectedCounties = this.cookieService.get(this.favouriteCountiesCookieKey);
if (selectedCounties.indexOf(county) > -1) {
selectedCounties = selectedCounties.replace(county + ' ', '');
} else {
selectedCounties += county + ' ';
}
this.indicators.forEach(indicator => indicator.performers.forEach(performer => performer.favourite = selectedCounties.indexOf(performer.county) > -1));
this.cookieService.set(this.favouriteCountiesCookieKey, selectedCounties);
this.LoadData();
}
示例6: setCookieValue
setCookieValue(key: string, value: string, expireDate?: Date, path?: string): void {
this.cookie.set(key, value, expireDate, path);
}
示例7: addCookie
// STEPS TO WRITING A REVIEW
// 1) All required fields are filled out
// 2) Check if cookie exists, else create
// 3) If cookie exists and no review then add new review
addCookie(c_id: string) {
const cookieCollection = this.db.collection('cookies');
this.cs.set('c_id', c_id);
return cookieCollection.add({'_id': c_id}).catch(err => { return console.error(err)});
}
示例8: resolve
.then(function(docRef) {
this.cookieService.set("userId", docRef.id );
this.jogoService.acrescentaJogador(jogoId);
resolve(docRef.id);
}.bind(this))
示例9: resolve
this.jogos.add(jogo).then(function(docRef) {
this.cookieService.set("jogoId", docRef.id );
resolve(docRef.id);
}.bind(this))
示例10: setVisaoCarta
setVisaoCarta(visaoCarta) {
this.cookieService.set("visaoCarta", visaoCarta );
}