标签:
{% block main %}
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.16/angular.min.js"></script>
<script type="text/javascript">
var blogposts = angular.module(‘blogposts‘, []);
blogposts.config(function ($interpolateProvider) {
$interpolateProvider.startSymbol(‘{[{‘);
$interpolateProvider.endSymbol(‘}]}‘);
});
blogposts.controller(‘blogController‘, function ($scope, $http) {
$http.get(‘/api/v1/url/?limit=600&format=json‘).success(function (data) {
$scope.posts = data["objects"];
});
});
</script>
<div ng-app="blogposts">
<div class="posts" ng-controller="blogController">
<ul>
<li ng-repeat="post in posts"><a href="/blog/{[{post.slug}]}">{[{post.title}]}</a></li>
</ul>
</div>
</div>
{% endblock %}
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/dale_dede/article/details/46754417