{"id":46939,"library":"angular4-hal","title":"angular4-hal","description":"Angular module providing a HAL/JSON HTTP client for interacting with Spring Data Rest APIs. Current stable version 7.11.2 requires Angular ^7.0.0 and RxJS ^6.0.0. Ships TypeScript definitions. Unlike generic HTTP clients, this library specializes in Hypertext Application Language (HAL) and Spring Data Rest resource models, offering automatic resource deserialization, linking, and navigation. Release cadence is low; the library is in maintenance mode. Key differentiator: seamless integration with Spring Boot backends.","status":"maintenance","version":"7.11.2","language":"javascript","source_language":"en","source_url":"https://github.com/sante85/angular4-hal","tags":["javascript","Spring Data Rest","Spring","HAL","hypermedia","REST","Angular 4","Angular 5","Angular 6","typescript"],"install":[{"cmd":"npm install angular4-hal","lang":"bash","label":"npm"},{"cmd":"yarn add angular4-hal","lang":"bash","label":"yarn"},{"cmd":"pnpm add angular4-hal","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use main export; avoid deep imports.","wrong":"import { HalModule } from 'angular4-hal/src/hal';","symbol":"HalModule","correct":"import { HalModule } from 'angular4-hal';"},{"note":"ESM only; require() will fail in Angular CLI/webpack setups.","wrong":"const RestService = require('angular4-hal').RestService;","symbol":"RestService","correct":"import { RestService } from 'angular4-hal';"},{"note":"Resource is a named export from the main module.","wrong":"import { Resource } from 'angular4-hal/resource';","symbol":"Resource","correct":"import { Resource } from 'angular4-hal';"},{"note":"Configuration class is named HalConfiguration, not HalConfig.","wrong":"import { HalConfig } from 'angular4-hal';","symbol":"HalConfiguration","correct":"import { HalConfiguration } from 'angular4-hal';"}],"quickstart":{"code":"import { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { HalModule, Resource, RestService } from 'angular4-hal';\nimport { HttpClientModule } from '@angular/common/http';\n\nclass MyResource extends Resource {\n  id: number;\n  name: string;\n}\n\n@NgModule({\n  imports: [\n    BrowserModule,\n    HttpClientModule,\n    HalModule.forRoot({\n      apiUrl: process.env['API_URL'] ?? 'http://localhost:8080/api'\n    })\n  ],\n  providers: [RestService]\n})\nexport class AppModule {}\n\n// In a component:\n@Component({...})\nexport class MyComponent {\n  constructor(private rest: RestService) {}\n  ngOnInit() {\n    this.rest.getAll<MyResource>('items').subscribe(items => console.log(items));\n  }\n}","lang":"typescript","description":"Shows setting up HalModule with configuration and using RestService to fetch HAL resources."},"warnings":[{"fix":"Use angular4-hal 6.x for Angular 6, or 5.x for Angular 5.","message":"Package version 7.x is only compatible with Angular 7.","severity":"breaking","affected_versions":">=7.0.0 <8.0.0"},{"fix":"Update to use .subscribe() or .toPromise() as needed.","message":"Since v7, RestService methods return Observable instead of Promise.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Use provideHalConfig({ apiUrl: '...' }) in providers.","message":"HalModule.forRoot() is deprecated; use provideHalConfig() instead.","severity":"deprecated","affected_versions":">=7.0.0 <7.12.0"},{"fix":"Ensure Resource subclasses have a default constructor.","message":"Resource class requires a default constructor with no arguments.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'4':83 '5':85 '6':87 '6.0.0':27 '7.0.0':24 '7.11.2':21 'angular':4,23,82,84,86 'angular4':2 'angular4-hal':1 'api':17 'applic':40 'automat':50 'backend':73 'boot':72 'cadenc':57 'client':10,34 'current':18 'data':15,45,76 'definit':30 'deseri':52 'differenti':67 'generic':32 'hal':3,42,79 'hal/json':8 'http':9,33 'hypermedia':80 'hypertext':39 'integr':69 'interact':12 'javascript':74 'key':66 'languag':41 'librari':36,61 'link':53 'low':59 'mainten':64 'mode':65 'model':48 'modul':5 'navig':55 'offer':49 'provid':6 'releas':56 'requir':22 'resourc':47,51 'rest':16,46,77,81 'rxjs':26 'seamless':68 'ship':28 'special':37 'spring':14,44,71,75,78 'stabl':19 'typescript':29,88 'unlik':31 'version':20","created_at":"2026-06-07T16:48:41.363239+00:00","updated_at":"2026-06-07T16:48:41.363239+00:00","problems":[{"fix":"Run npm install angular4-hal --save and import from 'angular4-hal'.","cause":"Missing dependency or wrong import path.","error":"Error: Can't resolve 'angular4-hal' in ..."},{"fix":"Install @types/angular or downgrade TypeScript to 2.9.x.","cause":"TypeScript version mismatch or missing @types/angular.","error":"ERROR in node_modules/angular4-hal/lib/hal.d.ts:1:22 - error TS2688: Cannot find type definition file for '...'."},{"fix":"Add HalModule.forRoot({...}) to imports array of NgModule.","cause":"HalModule not imported or not configured correctly.","error":"No provider for HalConfiguration!"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sante85/angular4-hal#readme","github":"https://github.com/sante85/angular4-hal","docs":null,"changelog":null,"pypi":null,"npm":"angular4-hal","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}