Questo.router.navigare in angolare

Esempi di codice

6
0

router angolare navigare

// Here’s a basic example using the navigate method:

goPlaces() {
  this.router.navigate(['/', 'page-name']);
}

/*
I hope it will help you.
Namaste
*/
2
0

angular naviga usando il componente

//ng new routing-app --routing
//ng generate component first
//ng generate component second
    
import { Router } from '@angular/router';

...

export class AboutUserComponent implements OnInit {
  user: User;

  constructor(
    private route: ActivatedRoute, 
    private service: UserService,
    private router: Router
  ) {}

  ngOnInit() {
    // grab the current username
    let username = this.route.snapshot.params['username'];
    this.service.getUser(username).then(user => this.user = user);
  }

  goBack() {
    this.router.navigate(['/about']);
  }

}
0
0

questo.router.navigare

<a [routerLink]="['/', 'red-pill', {x: 'white-rabbit'}, 'neo']">
  Param!
</a>

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................