anorgatarrak-wordpress-theme/app/catalog/item.component.js

21 lines
794 B
JavaScript
Raw Normal View History

angular.
module('item').
component('anDetail', {
2017-11-09 19:40:49 +01:00
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) {
2018-02-15 19:26:12 +01:00
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); });
// }
//]
});