What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-02 19:35:22
how to make a deck of cards in javascript
class Deck{ constructor(){ this.deck = []; this.reset(); this.shuffle(); } reset(){ this.deck = []; const suits = ['Hearts', 'Spades', 'Clubs', 'Diamonds']; const values = ['Ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen'... Add solution -
Other 2022-03-02 10:45:10
button routing
<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 -
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 -
Javascript 2022-03-01 06:25:09
getting view height dynamically in react native
import React, { Component } from 'react'; import ReactNative, { AppRegistry, View, TouchableOpacity, findNodeHandle, Text, StyleSheet } from 'react-native'; export default class App extends Component { constructor() { super(); this.state = {... Add solution -
TypeScript 2022-02-28 17:05:12
Cannot read property 'bypassSecurityTrustResourceUrl'
// This error is not about what you pass as an argument, // but about the sanitizer. // You need to make sure to import and declare the sanitizer // in your constructor like this: import { DomSanitizer} from '@angular/platform-browser'; ... construct... Add solution -
TypeScript 2022-02-26 12:35:16
typescript readonly
class Octopus { readonly name: string; readonly numberOfLegs: number = 8; constructor(theName: string) { this.name = theName; }} let dad = new Octopus("Man with the 8 strong legs");dad.name = "Man with the 3-piece suit";Cannot ... Add solution -
TypeScript 2022-02-25 12:45:03
mat datepicker timezone not correct
import { Inject, Injectable, Optional } from '@angular/core'; import { MAT_DATE_LOCALE } from '@angular/material'; import { MomentDateAdapter } from '@angular/material-moment-adapter'; import { Moment } from 'moment'; import * as moment from 'moment'; ... Add solution
Best helpers
Ranking is empty