當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。