JSFiddle - React, Tailwind, and code Playground
by fredrik
HTML
<div data-ng-app="test-app">
<div data-ng-controller="BenderController">
</div>
</div>
JavaScript
angular.module('presentationServices', ['ngResource']).
factory('Presentation', function ($resource) {
return $resource('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=fbonander', {
urlOptions : {
encodeUri : false
},
query : {
method : 'GET',
isArray : false
}
});
});
angular.module('test-app', ['presentationServices']);
function BenderController ($scope, Presentation) {
$scope.currentIndex = 0;
$scope.items = Presentation.get(function () {
alert('a');
});
$scope.$watch("currentIndex", function (newValue, oldValue) {
alert(newValue + ' ' + oldValue);
});
}