angular-github-api-factory is an angularjs module with a github api factory.
Author: Jonathan Hornung (JohnnyTheTank )
Usage
Install via either bower , npm or downloaded files:
bower install --save angular-github-api-factory
npm install --save angular-github-api-factory
download angular-github-api-factory.zip
Include dependencies in your HTML.
When using bower:
< script src = " bower_components/angular-github-api-factory/dist/angular-github-api-factory.min.js " > < / script >
When using npm:
< script src = " node_modules/angular-github-api-factory/dist/angular-github-api-factory.min.js " > < / script >
when using downloaded files
< script src = " angular-github-api-factory.min.js " > < / script >
Add jtt_github to your application's module dependencies.
Use the factory githubFactory
factory methods
getUser
githubFactory . getUser ( {
user : " <USERNAME_NAME> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
githubFactory . getUsers ( {
q : " <SEARCH_STRING> " ,
sort : " <SORT_STRING> " ,
order : " <SORT_ORDER> " ,
per_page : " <ITEMS_PER_PAGE> " ,
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
getRepo
githubFactory . getRepoByUserAndName ( {
user : " <USER_NAME> " ,
repo : " <REPO_NAME> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
getRepos
githubFactory . getReposByName ( {
q : " <SEARCH_STRING> " ,
sort : " <SORT_STRING> " ,
order : " <SORT_ORDER> " ,
per_page : " <ITEMS_PER_PAGE> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
githubFactory . getReposByUser ( {
user : " <USER_NAME> " ,
q : " <SEARCH_STRING> " ,
sort : " <SORT_STRING> " ,
order : " <SORT_ORDER> " ,
per_page : " <ITEMS_PER_PAGE> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
getEvents
githubFactory . getEventsFromRepoByUserAndName ( {
user : " <USER_NAME> " ,
repo : " <REPO_NAME> " ,
q : " <SEARCH_STRING> " ,
sort : " <SORT_STRING> " ,
order : " <SORT_ORDER> " ,
per_page : " <ITEMS_PER_PAGE> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
githubFactory . getEventsByUser ( {
user : " <USER_NAME> " ,
q : " <SEARCH_STRING> " ,
sort : " <SORT_STRING> " ,
order : " <SORT_ORDER> " ,
per_page : " <ITEMS_PER_PAGE> " ,
access_token : " <ACCESS_TOKEN> "
} ) . then ( function ( _data ) {
} ) . catch ( function ( _data ) {
} ) ;
Github JSON API
More angular-api-factories
bandsintown - dailymotion - facebook - footballdata - flickr - github - openweathermap - tumblr - vimeo - wikipedia - youtube
License
MIT