Skip to content

A small AngularJS Service to query an endpoint in a stateful way.

Notifications You must be signed in to change notification settings

marcelokanzaki/StatefulResource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SatefulResource (work in progress)

A small AngularJS Service to query an endpoint in a stateful way.

Usage

Lets say you want to build something like GitHub Issues using AngularJS...

var issues = new SatefulResource('/issues').query() // GET /issues
issues.models // bindable issues array

issues.query({state: 'closed'}) // GET /issues?state=closed
issues.models // issues with state 'closed'

issues.query({author: 'bughunter'}) // GET /issues?state=closed&author=bughunter
issues.models // issues with state 'closed' AND with 'bughunter' as author

issues.query({state: null}) // GET /issues?author=bughunter (notice that the "state" param was removed)
issues.models // issues with state 'closed'

About

A small AngularJS Service to query an endpoint in a stateful way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages