angular. module('item'). component('anDetail', { templateUrl: localized.partials + '/item-detail.template.html', controller: function($scope, $http, $routeParams, $sce, SubdomainService) { //console.log($routeParams.slug); $scope.lang = SubdomainService.subdomain; $http.get('wp-json/wp/v2/entrevista/?slug='+$routeParams.slug).then(function(res) { //console.log(res.data[0]); $scope.post = res.data[0]; }); } // controller: ['$routeParams', // function ItemDetailController($routeParams) { // this.itemId = $routeParams.itemId; // $http.get('wp-json/wp/v2/entrevistas/?slug='+$routeParams.slug).then(function(res) { $scope.post = res.data[0]; $scope.content = $sce.trustAsHtml($scope.post.content.rendered); }); // } //] });