Get started with angular-restmod CDN

MIT licensed

Angular-restmod is a library for AngularJS that simplifies RESTful API interactions using a fluent interface.

Tags:
  • angular
  • restmod

Stable version

Copied!

How to start using angular-restmod CDN


import { Component } from '@angular/core';
import { RestService } from 'angular-rest-client/ngx';
import RestMod from 'angular-restmod/ngx/RestMod';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(private rest: RestService) {
    this.initializeRestMod();
  }

  initializeRestMod() {
    RestMod.setBaseURL('/api'); // Set your base API URL
    const UserResource = RestMod.createResource('users');

    UserResource.getList().then(users => {
      console.log('Users:', users);
    });
  }
}
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions