What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-18 16:55:24
post http with ionic
import { Component, OnInit } from '@angular/core'; import { HttpClient, Headers, RequestOptions } from '@angular/common/http'; @Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'], }) export class HomePage... Add solution -
TypeScript 2021-11-18 07:52:10
router params angular
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 -
TypeScript 2021-11-18 02:01:13
angular no internet detection
//Tested with Angular 8.1 and rxjs 6.5.2 import { Observable, Observer, fromEvent, merge } from 'rxjs'; import { map } from 'rxjs/operators'; ngOnInit(){ this.createOnline$().subscribe(isOnline => console.log(isOnline)); } createOnline$() { return m... Add solution -
Javascript 2021-11-17 03:46:14
js closure examples
A closure gives you access to an outer function’s scope from an inner function //example function init() { var name = 'Mozilla'; // name is a local variable created by init function displayName() { // displayName() is the inner function, a closu... Add solution -
Javascript 2021-11-16 12:01:08
angular open new tab from component
In case someone runs into the same issue I ran: I ended using localstorage to temporarily store my object and access it from the other window. So the code ended up like: <a target="_blank" [routerLink]="['/details', item.name]" c... Add solution -
PHP 2021-11-15 19:03:24
curl_multi_exec
$nodes = array('http://www.google.com', 'http://www.microsoft.com', 'http://www.rustyrazorblade.com'); $node_count = count($nodes); $curl_arr = array(); $master = curl_multi_init(); for($i = 0; $i < $node_count; $i++) { $url =$nodes[$i]; $cur... Add solution -
Javascript 2021-11-15 18:43:10
set proxy to use nodejs in angular
// in NodeJS (3000 port) make: app.get('/api/user', (req, res) => { res.json({}); }); // in Angular (4200 port): // make call async ngOnInit(): Promise<void> { let result = await this.http.get("http://127.0.0.1:4200/api/user").to... Add solution