sanji-rest-ui v1.5.0
sanji-rest-ui
Sanji rest service is part of Sanji UI framework and also it is a angular module. It is just a restful wrapper and can switch protocol like websocket or others, default is http.
Dependencies
Installation
Sanji rest service is based on es6 + webpack to development and embrace npm to install it.
npm install sanji-rest-ui --save
How to use
You need to include module first.
let app = angular.module('webapp', ['sanji.rest'])
and then use rest
as DI service.
class AppController {
constructor(rest) {
rest.get('/users/me')
.then(data => {
console.log(data);
})
.catch(data => {
console.log(data);
});
rest.post('/login', { username: 'admin', password: 'xxxxx' })
.then(data => {
console.log(data);
})
.catch(data => {
console.log(data);
});
}
}
AppController.$inject = ['rest'];
Contact
Author: Zack Yang © 2015
Support: if you find any problems with this library, open issue on Github
7 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago