Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
Angular register es6 proxy as service

I trying to find a way to create something like DRY http client service, that will provide a boilerplate implementation for the backend calls based on a short API scheme description.

I would like to know is it possible to register es6 Proxy as angular service?

I need something like that:

import { Injectable } from "@angular/core";

const API = Object.freeze({
  'user': {
    endpoint: '/api/user/:id',
    methods: ['GET', 'POST']
  },

  'users': {
    endpoint: '/api/users',
    methods: ['GET', 'POST']
  }
});

// HOW TO: register something like this
@Injectable({ provideIn: 'root'})
const HttpClient = new Proxy(API, {
  apply(target, thisArg, ...args) {
    // Internal implementation
  }
});

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda