JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="hatena">
<div ng-controller="Controller">
<ul>
<li ng-repeat="bookmark in bookmarks">
{{bookmark.user}} 「{{bookmark.comment}}」{{bookmark.timestamp}}
<hr ng-show="!$last">
</li>
</ul>
</div>
</div>
JavaScript
angular.module("hatena", [], function () {
})
.factory("hatenaService", function ($http) {
return new HatenaService($http);
});
function HatenaService($http) {
this.getList = function (url) {
return $http({
method: "JSONP",
url: "http://b.hatena.ne.jp/entry/json/?url=" + encodeURIComponent(url) + "&callback=JSON_CALLBACK"
});
};
}
function Controller($scope, hatenaService) {
hatenaService
.getList("http://qiita.com/items/82aa9dde64826d25407d")
.success(function(data) {
$scope.bookmarks = data.bookmarks;
});
};