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