JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.angularjs.org/1.0.3/angular-resource.min.js"></script>
<div ng-app='test-app' ng-controller="testCtrl">
<span ng-click='refresh()'>refresh</span>
<div ng-repeat='item in items'>
{{item}}
<hr />
</div>
</div>
JavaScript
angular.module("test-app", ["ngResource"])
.factory("Items", function($resource) {
return $resource('http://search.twitter.com/:action', {
action: 'search.json',
q: 'angularjs',
callback: 'JSON_CALLBACK'
}, {
get: {
method: 'JSONP'
}
});
});
function testCtrl($scope, Items) {
$scope.items = Items.get();
$scope.refresh = function(){
$scope.items = Items.get();
}
}