当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Location.back方法代码示例

本文整理汇总了TypeScript中@angular/common.Location.back方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Location.back方法的具体用法?TypeScript Location.back怎么用?TypeScript Location.back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/common.Location的用法示例。


在下文中一共展示了Location.back方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: onClose

 onClose(){
     if(this.lh.is){
         this.location.back()
     }else{
         this.router.navigate(['/auth/map']);
     }
 }
开发者ID:Maxislav,项目名称:Atlas-Angular2,代码行数:7,代码来源:friends-component.ts

示例2: canActivate

 canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
   if(!localStorage.getItem('username')){
     return true;
   }
   this._location.back();
   return false;
 }
开发者ID:giangdhwhtbr,项目名称:CapstoneProjectKShare,代码行数:7,代码来源:auth.ts

示例3: save

 save(){
   this.service.save({
     firstname : this.firstname,
     lastname : this.lastname
   });
   this.location.back();
 }
开发者ID:NathanWalker,项目名称:nativescript-couchbase,代码行数:7,代码来源:create.component.ts

示例4: switch

    .subscribe(action => {
      const { path, query: queryParams, extras = {} }: RouterMethodCall = action.payload;
      let commands: any[] = Array.isArray(path) ? path : [path];

      switch (action.type) {
        case routerActions.GO:
          router.navigate(commands, Object.assign({}, extras, { queryParams }));
          break;

        case routerActions.REPLACE:
          router.navigate(commands, Object.assign({}, extras, { queryParams, replaceUrl: true }));
          break;

        case routerActions.SEARCH:
          let urlTree: UrlTree = router.parseUrl(router.url);
          urlTree.queryParams = queryParams;
          router.navigateByUrl(urlTree, extras);
          break;

        case routerActions.SHOW:
          router.navigate(commands, Object.assign({}, extras, { queryParams, skipLocationChange: true }));
          break;

        case routerActions.BACK:
          location.back();
          break;

        case routerActions.FORWARD:
          location.forward();
          break;
      }
    });
开发者ID:ngrx,项目名称:router-store,代码行数:32,代码来源:connect.ts

示例5: if

      .subscribe(data => {

        // Login denied
        if (!data.success) {
          if (data.status === 1) {
            this.flashMsg.show('Wrong username!', { cssClass: 'notification is-danger' });
          } else if (data.status === 2) {
            this.flashMsg.show('Wrong password!', { cssClass: 'notification is-danger' });
          } else {
            this.flashMsg.show(data.msg, { cssClass: 'notification is-danger' });
          }
          this.username = '';
          this.password = '';
          return;
        }

        // Login allowed
        if (data.success && data.status === 0) {
          this.auth.storeToken(data.token, data.user);
          return this.location.back();
        } else {
          this.flashMsg.show('Error', { cssClass: 'notification is-danger' });
        }

      });
开发者ID:schoettkr,项目名称:nightlife-app,代码行数:25,代码来源:login.component.ts

示例6: save

  // check to make sure first/lastname variables not empty
  // if true push new object with them to personList []
  // re-save serialized version of that array
  // then go back in navigation stack
  save() {
    if (this.firstname != "" && this.lastname != "") {
      this.personList.push({firstname: this.firstname, lastname: this.lastname});

      localStorage.setItem("people", JSON.stringify(this.personList));
      this.location.back();
    }
  }
开发者ID:caraclarke,项目名称:angular-nativescr-practice,代码行数:12,代码来源:create.component.ts

示例7: save

 save() {
     if(this.firstname != "" && this.lastname != "") {
         var people: Array<Object> = JSON.parse(applicationSettings.getString("people", "[]"));
         people.push({firstname: this.firstname, lastname: this.lastname});
         applicationSettings.setString("people", JSON.stringify(people));
         this.location.back();
     }
 }
开发者ID:RoRoche,项目名称:NativeScriptStarter,代码行数:8,代码来源:create.component.ts

示例8: save

 save(){
     if(this.firstname != '' && this.lastname != ''){
         this.personList.push({firstname: this.firstname, lastname: this.lastname});
         ApplicationSettings.setString('people', JSON.stringify(this.personList));
         this.location.back();
     }else{
         console.log('Not able to save');
     }
 }
开发者ID:jfbourne,项目名称:native-script,代码行数:9,代码来源:index.ts

示例9: save

 save() {
     if(this.firstname != "" && this.lastname != "") {
         this.database.createDocument({
             "firstname": this.firstname,
             "lastname": this.lastname
         });
         this.location.back();
     }
 }
开发者ID:couchbaselabs,项目名称:nativescript-couchbase,代码行数:9,代码来源:create.component.ts

示例10: updateInstitution

  public updateInstitution() {
    let institution = Object.assign(this.institution, this.institutionFormGroup.value);
    institution.regionType = this.getRegionType(institution.place);

    institution.totalBusyPersonalNumber = (institution.busyDoctorNumber || 0) + (institution.middleBusyPersonalNumber || 0) + (institution.otherBusyPersonalNumber);
    institution.totalIndividualsPersonalNumber = (institution.individualsDoctorNumber || 0) + (institution.middleIndividualsPersonalNumber || 0) + (institution.otherIndividualsPersonalNumber || 0);
    institution.totalRegularPersonalNumber = (institution.regularDoctorNumber || 0) + (institution.middleRegularPersonalNumber || 0) + (institution.otherRegularPersonalNumber || 0);
    
    this.institutionService.update(institution.id, institution);
    this.location.back();
  }
开发者ID:,项目名称:,代码行数:11,代码来源:


注:本文中的@angular/common.Location.back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。