Commit 56475a644d13c70b3e9081fc3dc11d0e27449f44

Authored by Victor Costa
1 parent 8700980c

Fix shared parameters

src/app/content-viewer/content-viewer.controller.js
@@ -7,14 +7,13 @@ @@ -7,14 +7,13 @@
7 7
8 8
9 /** @ngInject */ 9 /** @ngInject */
10 - function ContentViewerController(noosfero, $log, $stateParams, $state) { 10 + function ContentViewerController(noosfero, $log, $stateParams, $scope) {
11 var vm = this; 11 var vm = this;
12 vm.article = null; 12 vm.article = null;
13 activate(); 13 activate();
14 14
15 function activate() { 15 function activate() {
16 - console.log($state.current.data);  
17 - noosfero.communities.one($state.current.data.profile.id).one('articles').get({path: $stateParams.page}).then(function(articles) { 16 + noosfero.communities.one($scope.vm.owner.id).one('articles').get({path: $stateParams.page}).then(function(articles) {
18 $log.log(articles); 17 $log.log(articles);
19 vm.content = articles.article; 18 vm.content = articles.article;
20 }); 19 });
src/app/index.route.js
@@ -13,10 +13,7 @@ @@ -13,10 +13,7 @@
13 url: '/:profile', 13 url: '/:profile',
14 templateUrl: 'app/profile/profile.html', 14 templateUrl: 'app/profile/profile.html',
15 controller: 'ProfileController', 15 controller: 'ProfileController',
16 - controllerAs: 'vm',  
17 - data: {  
18 - profile: null  
19 - } 16 + controllerAs: 'vm'
20 }) 17 })
21 .state('profile.page', { 18 .state('profile.page', {
22 url: '/{page:.*}', 19 url: '/{page:.*}',
src/app/profile/profile.controller.js
@@ -16,7 +16,6 @@ @@ -16,7 +16,6 @@
16 noosfero.communities.one().get({private_token: '1b00325e5f769a0c38550bd35b3f1d64', identifier: $stateParams.profile}).then(function(communities) { 16 noosfero.communities.one().get({private_token: '1b00325e5f769a0c38550bd35b3f1d64', identifier: $stateParams.profile}).then(function(communities) {
17 $log.log(communities); 17 $log.log(communities);
18 vm.owner = communities.communities[0]; 18 vm.owner = communities.communities[0];
19 - $state.current.data.profile = vm.owner;  
20 }); 19 });
21 } 20 }
22 21