What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-02 09:40:08
nangular make window available
import { Inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; export class MyClass { constructor(@Inject(DOCUMENT) private document: Document) { this.window = this.document.defaultView; } check() { console.log(this.... Add solution -
TypeScript 2022-02-17 02:45:01
typescript ge t current screen resolution
import { Component, OnInit, OnDestroy, Input } from "@angular/core"; // Import this, and write at the top of your .ts file import { HostListener } from "@angular/core"; @Component({ selector: "app-login", templateUrl: '.... Add solution -
Javascript 2022-01-23 00:50:47
javascript this = that
// In web browsers, the window object is also the global object: console.log(this === window); // true a = 37; console.log(window.a); // 37 this.b = "MDN"; console.log(window.b) // "MDN" console.log(b) // "MDN" Add solution -
Javascript 2022-01-22 23:16:04
get child routes using parent in angular
constructor(private _route: ActivatedRoute, private _router: Router) this._router.events .filter(event => event instanceof NavigationEnd) .subscribe( () => { console.log(this._route.snapshot.firstChild.data); } ); Add solution -
Javascript 2022-01-22 20:31:11
immutability helper
import React, { Component } from "react"; import "./styles.css"; import update from "immutability-helper"; class App extends Component { state = { pizzas: { margherita: { toppings: ["tomato sauce&quo... Add solution -
Javascript 2022-01-22 04:45:15
what is this in javascript
// this = current execution context (window in browser, global in nodejs) console.log(this) // window object function foo () { console.log(this); // object calling this function } foo(); // undefined o={ foo } o.foo(); // 'o' object logged 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