Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!