Home

Awesome

angular-facebook-api-factory is an angularjs module with a facebook api factory.

npm version Bower version

Author: Jonathan Hornung (JohnnyTheTank)

Usage

  1. Install via either bower, npm or downloaded files:
    1. bower install --save angular-facebook-api-factory
    2. npm install --save angular-facebook-api-factory
    3. download angular-facebook-api-factory.zip
  2. Add jtt_facebook to your application's module dependencies.
  3. Include dependencies in your HTML.
    1. When using bower:
    <script src="bower_components/angular-facebook-api-factory/dist/angular-facebook-api-factory.min.js"></script>
    
    1. When using npm:
    <script src="node_modules/angular-facebook-api-factory/dist/angular-facebook-api-factory.min.js"></script>
    
    1. when using downloaded files
    <script src="angular-facebook-api-factory.min.js"></script>
    
  4. Use the factory facebookFactory

factory methods

getPosts

facebookFactory.getPostsFromPageById({
    page:"<PAGE_ID>",
    limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
    until:"<UNTIL>", // (optional)
    since:"<SINCE>", // (optional)
    __previous:"<PREVIOUS>", // (optional)
    __paging_token:"<PAGING_TOKEN>", // (optional)
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getPhotos

facebookFactory.getPhotosFromPageById({
    page:"<PAGE>", // ID or name
    limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
    before:"<BEFORE>", // (optional)
    after:"<AFTER>", // (optional)
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getVideos

facebookFactory.getVideosFromPageById({
    page:"<PAGE_ID>",
    limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
    before:"<BEFORE>", // (optional)
    after:"<AFTER>", // (optional)
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getEvents

facebookFactory.getEventsFromPageById({
    page:"<PAGE_ID>",
    limit:"<LIMIT>", // (optional) valid values: 0-100 | default: 25
    before:"<BEFORE>", // (optional)
    after:"<AFTER>", // (optional)
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

getPage

facebookFactory.getPageById({
    page:"<PAGE_ID>",
    access_token:"<ACCESS_TOKEN>"
}).then(function (_data) {
    //on success
}).catch(function (_data) {
    //on error
});

Facebook Graph JSON API

More angular-api-factories

bandsintown - dailymotion - facebook - flickr - footballdata - github - openweathermap - tumblr - vimeo - wikipedia - youtube

License

MIT