What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-21 09:38:04
how to manually trigger browser back button from angular
import { Injectable } from '@angular/core' import { Location } from '@angular/common' import { Router, NavigationEnd } from '@angular/router' @Injectable({ providedIn: 'root' }) export class NavigationService { private history: string[] = [] constru... Add solution -
TypeScript 2021-10-05 15:51:02
pass data through router angular
// Send user data let navigationExtras: NavigationExtras = { state: { user: this.user } this.router.navigate(['details'], navigationExtras); // Acess data in details page .... constructor(private route: ActivatedRoute, private router: Router) { th... Add solution -
Other 2021-10-04 05:52:03
get current url ionic 4
With pure JavaScript: console.log(window.location.href); Using Angular: this.router.url import { Component } from '@angular/core'; import { Router } from '@angular/router'; @Component({ template: 'The href is: {{href}}' /* Other component... Add solution -
Javascript 2021-10-02 15:13:03
angular router with wuery param
goProducts() { this.router.navigate(['/products'], { queryParams: { order: 'popular' } }); } http://localhost:4200/products?order=popular constructor(private route: ActivatedRoute) { } ngOnInit() { this.route.queryParams .filter(params =... Add solution -
Javascript 2021-10-02 02:23:04
routerlink for button in angular 7
<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button> // myComponent.component.ts file import { Router } from '@... Add solution -
Other 2021-09-20 08:53:02
ionic detect router change
import { Component } from '@angular/core'; import { Router, Event, NavigationStart, NavigationEnd, NavigationError } from '@angular/router'; @Component({ selector: 'app-root', template: `<router-outlet></router-outlet>` }) export cla... Add solution -
Javascript 2021-09-16 19:51:02
add a route to a buttoin in angular
<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button> // myComponent.component.ts file import { Router } from '@... Add solution -
TypeScript 2021-09-16 00:53:02
how to pass data to another page in ionic 3
import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'app-details', templateUrl: './details.page.html', styleUrls: ['./details.page.s... Add solution