Commit 9ed8efe93dc3b0769ee091cf25137a603eae7903
1 parent
56475a64
Exists in
master
and in
38 other branches
Add articles directives
Showing
7 changed files
with
72 additions
and
4 deletions
Show diff stats
src/app/components/noosfero-articles/article/article.directive.js
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('angular') | |
6 | + .directive('noosferoArticle', noosferoArticle); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function noosferoArticle() { | |
10 | + var directive = { | |
11 | + restrict: 'E', | |
12 | + templateUrl: 'app/components/noosfero-articles/article/article.html', | |
13 | + scope: { | |
14 | + article: '=', | |
15 | + owner: '=' | |
16 | + }, | |
17 | + controller: ArticleController, | |
18 | + controllerAs: 'vm', | |
19 | + bindToController: true | |
20 | + }; | |
21 | + | |
22 | + return directive; | |
23 | + | |
24 | + /** @ngInject */ | |
25 | + function ArticleController() { | |
26 | + var vm = this; | |
27 | + } | |
28 | + } | |
29 | + | |
30 | +})(); | ... | ... |
src/app/components/noosfero-articles/article/article.html
0 → 100644
src/app/components/noosfero-articles/blog/blog.directive.js
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('angular') | |
6 | + .directive('noosferoBlog', noosferoBlog); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function noosferoBlog() { | |
10 | + var directive = { | |
11 | + restrict: 'E', | |
12 | + templateUrl: 'app/components/noosfero-articles/blog/blog.html', | |
13 | + scope: { | |
14 | + article: '=', | |
15 | + owner: '=' | |
16 | + }, | |
17 | + controller: BlogController, | |
18 | + controllerAs: 'vm', | |
19 | + bindToController: true | |
20 | + }; | |
21 | + | |
22 | + return directive; | |
23 | + | |
24 | + /** @ngInject */ | |
25 | + function BlogController() { | |
26 | + var vm = this; | |
27 | + } | |
28 | + } | |
29 | + | |
30 | +})(); | ... | ... |
src/app/content-viewer/content-viewer.controller.js
... | ... | @@ -14,8 +14,7 @@ |
14 | 14 | |
15 | 15 | function activate() { |
16 | 16 | noosfero.communities.one($scope.vm.owner.id).one('articles').get({path: $stateParams.page}).then(function(articles) { |
17 | - $log.log(articles); | |
18 | - vm.content = articles.article; | |
17 | + vm.article = articles.article; | |
19 | 18 | }); |
20 | 19 | } |
21 | 20 | } | ... | ... |
src/app/content-viewer/page.html
src/app/profile/profile.controller.js
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | |
15 | 15 | function activate() { |
16 | 16 | noosfero.communities.one().get({private_token: '1b00325e5f769a0c38550bd35b3f1d64', identifier: $stateParams.profile}).then(function(communities) { |
17 | - $log.log(communities); | |
18 | 17 | vm.owner = communities.communities[0]; |
19 | 18 | }); |
20 | 19 | } | ... | ... |