Currently, I am using the code below to fetch tweets for a timeline. This snippet was originally taken from an AngularJS tutorial and worked perfectly with Twitter's search API.
angular.module( 'Twitter', [ 'ngResource' ]);
function TwitterCtrl( $scope, $resource )
{
$scope.twit = $resource( 'https://api.twitter.com/1/statuses/:action',
{
action: 'user_timeline.json',
screen_name: 'jesus',
count: '6',
include_rts: '1',
callback: 'JSON_CALLBACK'
}, { get:{method:'JSONP' }});
$scope.twit.get();
}
Recently, I modified the code to fetch data from a timeline instead and encountered some issues. It seems like AngularJS is expecting an array when there isn't one. Can anyone explain what might be causing this problem?
TypeError: Object #<e> has no method 'push'
at copy (http://code.angularjs.org/1.1.0/angular.js:556:21)
at f.module.factory.e.(anonymous function) (http://code.angularjs.org/1.1.0/angular-resource.min.js:8:242)
at deferred.promise.then.wrappedCallback (http://code.angularjs.org/1.1.0/angular.js:6628:59)
at ref.then (http://code.angularjs.org/1.1.0/angular.js:6665:26)
at Object.$get.Scope.$eval (http://code.angularjs.org/1.1.0/angular.js:7813:28)
at Object.$get.Scope.$digest (http://code.angularjs.org/1.1.0/angular.js:7685:25)
at Object.$get.Scope.$apply (http://code.angularjs.org/1.1.0/angular.js:7899:24)
at done (http://code.angularjs.org/1.1.0/angular.js:8891:20)
at completeRequest (http://code.angularjs.org/1.1.0/angular.js:9035:7)
at http://code.angularjs.org/1.1.0/angular.js:8981:11