Skip to content

Instantly share code, notes, and snippets.

@ViewFromTheBox
Created December 19, 2016 02:46
Show Gist options
  • Select an option

  • Save ViewFromTheBox/fd11d02b914d9e9255eca975b6ffdd2c to your computer and use it in GitHub Desktop.

Select an option

Save ViewFromTheBox/fd11d02b914d9e9255eca975b6ffdd2c to your computer and use it in GitHub Desktop.
.controller('SinglePost', ['$scope', '$http', '$stateParams', 'Comments', 'SortComments', function ($scope, $http, $stateParams, Comments, SortComments) {
$http.get(myLocalized.api_url + 'posts?slug=' + $stateParams.slug + '&_embed').success(function(res){
$scope.post.comments = SortComments.arrangeComments( $scope.post.comments );
$scope.numComments = $scope.post.comments.length;
});
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment