當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript CookieService.set方法代碼示例

本文整理匯總了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');

    }
      
  }
開發者ID:nguyenquan263,項目名稱:SMS_System_Final,代碼行數:13,代碼來源:esl-seoi-listing.component.ts

示例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
    });
  }
開發者ID:nsarvar,項目名稱:animus-frontend,代碼行數:8,代碼來源:apartment-modify.component.ts

示例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);
   }
 }
開發者ID:gsuveti,項目名稱:primeng-material,代碼行數:9,代碼來源:dev-playground.component.ts

示例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 => {
開發者ID:caberrio,項目名稱:movies,代碼行數:11,代碼來源:auth.service.ts

示例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();
    }
開發者ID:OvidiuCaba,項目名稱:StatisticsRomania,代碼行數:15,代碼來源:performers.component.ts

示例6: setCookieValue

 setCookieValue(key: string, value: string, expireDate?: Date, path?: string): void {
     this.cookie.set(key, value, expireDate, path);
 }
開發者ID:staneee,項目名稱:ABPTemplateUI-ng-alain,代碼行數:3,代碼來源:utils.service.ts

示例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)});
    }
開發者ID:teandrew,項目名稱:pathFinder,代碼行數:10,代碼來源:review.service.ts

示例8: resolve

 .then(function(docRef) {
     this.cookieService.set("userId", docRef.id );
     this.jogoService.acrescentaJogador(jogoId);
     resolve(docRef.id);
 }.bind(this))
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:5,代碼來源:jogador.service.ts

示例9: resolve

 this.jogos.add(jogo).then(function(docRef) {
     this.cookieService.set("jogoId", docRef.id );
     resolve(docRef.id);
 }.bind(this))
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:4,代碼來源:jogo.service.ts

示例10: setVisaoCarta

 setVisaoCarta(visaoCarta) {
     this.cookieService.set("visaoCarta", visaoCarta );
 }
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:3,代碼來源:jogo.service.ts


注:本文中的ngx-cookie-service.CookieService.set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。