angular-hal

WebJar for angular-hal

License

License

Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-hal
Last Version

Last Version

2.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-hal
WebJar for angular-hal
Project URL

Project URL

http://webjars.org

Download angular-hal

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-hal/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-hal</artifactId>
    <version>2.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-hal/
implementation 'org.webjars.bower:angular-hal:2.3.0'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-hal/
implementation ("org.webjars.bower:angular-hal:2.3.0")
'org.webjars.bower:angular-hal:jar:2.3.0'
<dependency org="org.webjars.bower" name="angular-hal" rev="2.3.0">
  <artifact name="angular-hal" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-hal', version='2.3.0')
)
libraryDependencies += "org.webjars.bower" % "angular-hal" % "2.3.0"
[org.webjars.bower/angular-hal "2.3.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

angular-hal

Build Status Bower version npm version Dependency Status

npm install angular-hal --save

Check our Documentation

Versions

3.0.0

Version 3.0.0 includes a breaking change: the response interceptor no longer returns a Resource, instead it returns an Angular $http response object. This only affects consuming code when using the $http service directly.

To migrate from 2.x to 3.x, make the following change to your code:

const halConfig = {
    headers: {
        'Accept': 'application/hal+json'
    }
};

// 2.x
$http.get('/api/users', halConfig).then(function (resource) {
  console.log(resource.$hasEmbedded('users')); // true    
});

// 3.x
$http.get('/api/users', halConfig).then(function (response) {
  const resource = response.data;  
  console.log(resource.$hasEmbedded('users')); // true    
});

// 3.x with ES6
$http.get('/api/users', halConfig).then(({ data: resource }) => {
  console.log(resource.$hasEmbedded('users')); // true    
});

Other integrations points are unchanged. For example, using halResourceClient:

let $apiRoot;

$http.get('/api', halConfig)
  .then(function (response) {
    $apiRoot = response.data;   
  });

// later
$apiRoot.$request().$get('users')
  .then(function (resource) {
    console.log(resource.$hasEmbedded('users')); // true    
  });
org.webjars.bower

LuvDaSun

Versions

Version
2.3.0