本文整理汇总了TypeScript中angular2-cookie/services/cookies.service.CookieService.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.CookieService.get方法的具体用法?TypeScript service.CookieService.get怎么用?TypeScript service.CookieService.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2-cookie/services/cookies.service.CookieService
的用法示例。
在下文中一共展示了service.CookieService.get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: checkViewState
checkViewState(item, other) {
const itemId = this._cookie.get(item + 'Id');
const otherId = this._cookie.get(other + 'Id');
if(itemId) {
return true;
}
else {
if(!otherId) return true;
}
return false;
}
示例2: constructor
constructor(private translate: TranslateService, private cookie: CookieService, private balanceService: BalanceService) {
this.translate.setDefaultLang('en');
const language = this.cookie.get('language');
if (language) {
this.translate.use(language);
}
}
示例3: submitAnswer
submitAnswer(answer) {
let body = new FormData();
body.append('answer', answer);
body.append('csrfmiddlewaretoken', this.cookieService.get('csrftoken'));
return this.makePOSTAPICall('/kryptos/submitanswer', body);
}
示例4: ngOnInit
ngOnInit() {
this.consumerId = this._cookie.get('consumerId');
this.checkLikedStatus(this.consumerId);
}
示例5: onSubmitMessageForm
onSubmitMessageForm() {
const message = this.messageForm.value.message;
const consumer = this._cookie.get('consumer_token');
this.messageService.addMessage(message, consumer, this.cardId)
.subscribe((data) => {
const { content, id, author, likes } = data.obj;
const new_message = new Message(content, this.card.name, id, this.card.id, 0, [], []);
this.card.messages.push(new_message);
this.messageForm.reset();
});
}
示例6: makePOSTAPICall
public makePOSTAPICall(url, data) {
data.append('csrfmiddlewaretoken', this.cookieService.get('csrftoken'));
var loader = new ProgressiveLoader();
loader.placeLoader('Auth_ss');
var headers: Headers = new Headers();
headers.append('Content-Type', 'text/plain; charset=UTF-8');
return this.http.post(ApiRoot()+url, (data), { withCredentials: true })
.map(res => {
loader.removeLoader();
var x = res.json();
if (x.error)
this.router.navigate(['/signin']);
return x;
});
}
示例7: constructor
constructor(private companyService: CompanyService, private _cookie: CookieService) {
this.companyId = this._cookie.get('companyId');
}
示例8: isViewedByConsumer
isViewedByConsumer() {
return this._cookie.get('consumer_token');
}