'use strict'; angular .module('app') .component('post', { templateUrl: '/resources/post/post.component.html', controller: ['$scope', '$location', 'cms', function ($scope, $location, cms) { Object.assign($scope, { post: {}, }) this.$routerOnActivate = function (next, previous) { cms.news.get({ id: next.params.id }).$promise.then( post => { console.log('post', post) $scope.post = post; }, error => { console.log('news', error) } ) }; }] });