What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-09-15 19:02:01
Adding API request
import { Component, OnInit } from '@angular/core';import { HttpClient } from '@angular/common/http';...import { Quote } from '../quote-class/quote';....export class GoalComponent implements OnInit { goals:Goal[]; alertService:AlertServi... Add solution -
TypeScript 2021-09-15 18:29:02
typescript types for state
interface IProps { } interface IState { playOrPause?: string; } class Player extends React.Component<IProps, IState> { // ------------------------------------------^ constructor(props: IProps) { super(props); this.state = { pl... Add solution -
C# 2021-09-15 08:15:02
static initializer
Static blocks or static initializers are used to initalize static fields in java we declare static blocks when we want to intialize static fields in our class. Static blocks gets executed exactly once when the class is loaded Static blocks are executed ... Add solution -
Javascript 2021-09-15 07:36:03
bind an event to dom element angular
import { AfterViewInit, Component, ElementRef} from '@angular/core'; constructor(private elementRef:ElementRef) {} ngAfterViewInit() { this.elementRef.nativeElement.querySelector('my-element') .addEventListener('click',... Add solution -
Javascript 2021-09-14 12:51:03
cascading dropdown for forms react
import React from 'react'; class Dropdown extends React.Component { constructor(props) { super(props); this.state = { countries : [], states : [], cities : [], selectedCountry : '--Choose Country--', selectedState : '--Choose State--'... Add solution
Best helpers
Ranking is empty