trying to do a simple blog feed - no errors reported in chrome, but no
feeds either. Did get a "return deprecated" error - and not sure how
the suggested event.preventDefault() should be used to resolve that.
wondering if $scope.blogs is accessed correctly between ctrl - factory -
service
any ideas? thks.
<div ng-controller="BlogCtrl">
<div class="well">
<h1>Blog Feed</h1>
<div ng-repeat="blog in blogs | orderBy:'title' ">
<h4>{{blog.title}}</h4>
</div>
</div><!--well-->
</div><!--BlogCtrl-->
/* ==== BlogCtrl
================================= */
appControllers.controller('BlogCtrl', ['$scope','$http',
function($scope, $http) {
$scope.blogs=[];
}
]);
appControllers.factory('BlogLoader',
function($resource){
return $resource(
'http://ajax.googleapis.com/ajax/services/feed/load',
{},
{fetch:{method:'JSONP',params: {v:'1.0',callback:'JSON_CALLBACK'}}}
);
}
);
appControllers.service('BlogList',
function($rootScope,BlogLoader){
var blogurl = "http://tigernassau.blogspot.com/feeds/posts/default";
this.get = function() {
BlogLoader.fetch({q:blogurl, num:10},{},function(data){
var blog = data.responseData.blog;
$scope.blogs.push(blog);
});
return blogs;
};
}
);
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.