How can I redirect to another view-model in Aurelia JS?

to do that inject the router in the ViewModel and use the method navigate(route)

here is an example:

import {Router} from 'aurelia-router';

export class MyVM {

  static inject() { return [Router]; }

  constructor(router){
    this.router = router;
  }

  someMethod(){
    this.router.navigate("myroute");
  }
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)