Created
August 29, 2016 15:38
-
-
Save n8finch/a5ad58f0e2020f2b96ca6e12464d04aa to your computer and use it in GitHub Desktop.
adding-filter-to-rendered-posts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (angular) { | |
'use strict'; | |
angular.module('myApp', []) | |
.controller('example', ['$scope', '$http', function ($scope, $http) { | |
$http({ | |
url: 'https://n8finch.dev/wp-json/wp/v2/posts', | |
cache: true | |
}).success(function (res) { | |
$scope.posts = res; | |
console.log($scope.posts); | |
}); | |
}]) | |
.filter('to_trusted', ['$sce', function ($sce) { | |
return function (text) { | |
return $sce.trustAsHtml(text); | |
}; | |
}]); | |
})(window.angular); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment