Giter Site home page Giter Site logo

yrsdi / angular-refresh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vchatterji/angular-refresh

0.0 3.0 0.0 112 KB

A directive that allows you to load JSON data from any given URL periodically and update your scope

License: MIT License

angular-refresh's Introduction

angular-refresh

A directive that allows you to load JSON data from any given URL periodically and update your scope

Sample Plunker

You can find a sample Plunker at: http://plnkr.co/edit/oqBN8t

Usage

Include the script angular-refresh.js in your html page.

Make sure your angular module declares this module as a dependency:

angular.module('myApp',['datarefresh'])
	.controller('BodyController', [function () {
}]);

Include the tag in your HTML:

<!-- 
    Remember we can't use a self closing tag like <foo/>. We must use <foo></foo>
	
	You can either use 'get' or 'jsonp' as values for the method attribute.
	
	If you use any other value, it will default to 'get'
	
	The following example loads JSON data via JSONP from flickr and assigns it to the model flickr.
	
	If you are using 'jsonp' as your method, your url should include the string JSON_CALLBACK (as shown)
	as the callback for your service.
	
	The interval is the refresh interval in milli-seconds.
	
	The Url should include all the data you want to send to your service
-->
    <angular-refresh url="http://api.flickr.com/services/feeds/photos_public.gne?tagmode=all&format=json&jsoncallback=JSON_CALLBACK"
      ng-model="flickr" interval="5000" method="jsonp"></angular-refresh>
	  
	<div ng-repeat="item in flickr.items">
       {{ item.title }}
    </div>

angular-refresh's People

Contributors

vchatterji avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.