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


TypeScript Router.navigate方法代码示例

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


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

示例1:

 this.userService.resetUserPassword(this.userResetPasswordDto).then((result: data.IResult) =>
 {
     if (result.state === data.ResultStateEnum.Succeed)
     {
         this.router.navigate('#/user/login');
         Materialize.toast('Operation succeed. Login now !', 4000, 'btn');
     } else
     {
         for (let error of result.errors)
             Materialize.toast(error, 4000, 'btn orange');
     }
 });
开发者ID:GooRiOn,项目名称:Aurora,代码行数:12,代码来源:password-reset.ts

示例2:

 (data: any) =>
 {
     if ( data.response === 'done' )
     {
         this.updateData();
         this.router.navigate('profile');
     }
     else
     {
         this.controller.addError('Old password is wrong.', 'password')
         console.log( data )
     }
 }
开发者ID:yordan-milkov,项目名称:TaskBo-rd,代码行数:13,代码来源:editProfile.ts

示例3:

 this.createProjectService.createProject(this.newProject).then((result: data.IResult) =>
 {
     if (result.state === data.ResultStateEnum.Succeed)
     {
         Materialize.toast('Project created', 4000, 'btn');
         this.router.navigate('#/project/overview');
     }
     else
     {
         for (let error of result.errors)
             Materialize.toast(error, 4000, 'btn orange');
     }
         
 });
开发者ID:GooRiOn,项目名称:Aurora,代码行数:14,代码来源:project-create.ts

示例4: configureRouter

  public configureRouter(config: RouterConfiguration, router: Router) {
    config.title = 'TaskBo-rd';
    config.map([
      { route: ['', 'home'], name: 'home', moduleId: 'home', nav: true, title: 'Home'  },
      { route: 'profile', name: 'profile', moduleId: 'profile', nav: true, title: 'Profile', href: 'profile' },
      { route: 'logout', name: 'Logout', moduleId: 'logout', nav: true, title: 'Log Out', href: 'LogOut' },
      { route: 'editProfile', name: 'editProfile', moduleId: 'editProfile', nav: false, title: 'Edit Profile', href: 'editProfile' },
      { route: 'addEditGroup/:id', name: 'addEditGroup', moduleId: 'addEditGroup', nav: false, title: 'Edit Group', href: 'addEditGroup' },
      { route: 'group-tasks/:id', name: 'group-tasks', moduleId: 'group-tasks', nav: false, title: 'Tasks by group', href: 'group-tasks' },
      { route: 'task/:id', name: 'task', moduleId: 'task', nav: false, title: 'View task', href: 'task' },
      { route: 'edit/:id', name: 'editTask', moduleId: 'editTask', nav: false, title: 'Edit task', href: 'editTrask' }
    ]);

    this.router = router;
    this.router.navigate('/');
  }
开发者ID:yordan-milkov,项目名称:TaskBo-rd,代码行数:16,代码来源:app.ts

示例5: updateProfile

 updateProfile()
 {
     this.controller.reset();
     if ( String(this.user.newPass) === String(this.user.repeatPass) )
     {
         if ( ! String(this.user.newPass) )
         {
             this.updateData()
             this.router.navigate('profile');
         }
         else
         {
             this.connect.updateProfilePassword( this.user )
             .then(
                 (data: any) =>
                 {
                     if ( data.response === 'done' )
                     {
                         this.updateData();
                         this.router.navigate('profile');
                     }
                     else
                     {
                         this.controller.addError('Old password is wrong.', 'password')
                         console.log( data )
                     }
                 }
             );
             
         }
     }
     else
     {
         this.controller.addError('New password doen\'t match.', 'password')
     }
 }
开发者ID:yordan-milkov,项目名称:TaskBo-rd,代码行数:36,代码来源:editProfile.ts

示例6:

 .then((customer) => {
   console.log(customer, this.customer.isNew());
   return this.router.navigate('list');
 });
开发者ID:doktordirk,项目名称:aurelia-orm-loopback-sample,代码行数:4,代码来源:edit.ts

示例7:

 this._ea.subscribe(Events.polymerChosen, () => {
   this.router.navigate('polymer');
 });
开发者ID:avizcaino,项目名称:book-shelf,代码行数:3,代码来源:app.ts

示例8:

 this.session.logout().then(loggedOut => {
   this.router.navigate("/");
 });
开发者ID:rgwch,项目名称:webelexis,代码行数:3,代码来源:stage1.ts

示例9:

 this.userService.logout().then((result: data.IResult) =>
 {
     this.authService.clearAccessToken();
     this.authService.setUser(null);
     this.router.navigate('#/');
 });
开发者ID:GooRiOn,项目名称:Aurora,代码行数:6,代码来源:logout.ts

示例10:

 return this.http.delete(`/api/schedulers/${this.schedulerName}/calendars/${this.name}`).then(() => {
     toastr.success(`Calendar ${this.name} deleted successfully`);
     return this.router.navigate("calendars");
 });
开发者ID:Indifer,项目名称:quartznet,代码行数:4,代码来源:calendar-details.ts


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