Question

Is there any frontend application sample that consumes RESTful services of Spring-data-rest backend which is written with angularJS.

Was it helpful?

Solution

My prefer for rest api for angularjs is RESTANGULAR module...

In the site you can see many examples that how they deal with Rest calls and really good documentation and good community as well...

In this example which is from spring example SPRING.IO they uses $http, but I should say that Restangular uses $http as well, so basically you can say that Restangular is extended version of $http...

and for the last you can look for $resource...

I will update my answer If I will find something new...

OTHER TIPS

Here are some links to AngularJS apps consuming Spring RESTful services

https://github.com/spinner0815/spring-data-rest-angularjs

At the moment, I think that angular-hal is the best library to consume Spring Data Rest output and stay with its philosophy of discovering url through relations.

The home page: https://github.com/LuvDaSun/angular-hal

and some examples :

here has a nice lib spring-data-rest-js can help you. It's a easy to use and lightweight javascript lib can run in both node.js and browser. After use this lib you can manage entity like this way:

let springRest = require('spring-data-rest-js');
let Student = springRest.entity.extend('students');
let student = new Student();
student.set('name', 'Tom');
//create entity
student.save().then(()=> {
    //update entity
    student.set('name', 'Physics');
    retuen student.save();
}).then(()=> {
    //delete entity
    retuen student.delete();
}).catch(err=> {
    done(err);
})

base on fetch API and Promise,inspired by Parse. It can be work with lib like AngularJS React Vue...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top