How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { Injectable } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    
    @Injectable()
    export class ConfigService {
      constructor(private http: HttpClient) { }
    }
    Docs
  • import { Injectable } from '@angular/core';
    
    @Injectable({
      providedIn: 'root',
    })
    export class HeroService {
    
      constructor() { }
    
    }
    Docs
  • import { Injectable } from '@angular/core';
    
    @Injectable({
      providedIn: 'root',
    })
    export class MessageService {
      messages: string[] = [];
    
      add(message: string) {
        this.messages.push(message);
      }
    
      clear() {
        this.messages = [];
      }
    }
    Docs
  • import { Injectable } from '@angular/core';
    import {
      HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
    } from '@angular/common/http';
    
    import { Observable } from 'rxjs';
    
    /** Pass untouched request through to the next request handler. */
    @Injectable()
    export class NoopInterceptor implements HttpInterceptor {
    
      intercept(req: HttpRequest<any>, next: HttpHandler):
        Observable<HttpEvent<any>> {
        return next.handle(req);
      }
    }
    Docs
  • import { Inject, Injectable, InjectionToken } from '@angular/core';
    
    export const BROWSER_STORAGE = new InjectionToken<Storage>('Browser Storage', {
      providedIn: 'root',
      factory: () => localStorage
    });
    
    @Injectable({
      providedIn: 'root'
    })
    export class BrowserStorageService {
      constructor(@Inject(BROWSER_STORAGE) public storage: Storage) {}
    
      get(key: string) {
        return this.storage.getItem(key);
      }
    
      set(key: string, value: string) {
        this.storage.setItem(key, value);
      }
    
      remove(key: string) {
        this.storage.removeItem(key);
      }
    
      clear() {
        this.storage.clear();
      }
    }
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples