Commit fb625a65a351fee79c400010ebd44b585a96d250
1 parent
4dc642ee
Exists in
master
and in
8 other branches
Remove restangular
Showing
7 changed files
with
13 additions
and
18 deletions
Show diff stats
bower.json
src/app/index.config.js
... | ... | @@ -3,16 +3,9 @@ |
3 | 3 | |
4 | 4 | angular |
5 | 5 | .module('dialoga') |
6 | - .config(configRestangular) | |
7 | 6 | .config(config); |
8 | 7 | |
9 | 8 | /** @ngInject */ |
10 | - function configRestangular(RestangularProvider, api) { | |
11 | - RestangularProvider.setBaseUrl(api.host); | |
12 | - RestangularProvider.setDefaultRequestParams({ apiKey: api.token }); | |
13 | - } | |
14 | - | |
15 | - /** @ngInject */ | |
16 | 9 | function config($logProvider) { |
17 | 10 | // Enable log |
18 | 11 | $logProvider.debugEnabled(true); | ... | ... |
src/app/index.module.js
src/app/partials/article/article.service.js
... | ... | @@ -6,15 +6,14 @@ |
6 | 6 | .factory('ArticleService', ArticleService); |
7 | 7 | |
8 | 8 | /** @ngInject */ |
9 | - function ArticleService(Restangular, api, $log) { | |
9 | + function ArticleService($http, $q, api, $log) { | |
10 | 10 | $log.debug('ArticleService'); |
11 | 11 | |
12 | - var articlesRest = Restangular.all('articles'); | |
13 | - | |
12 | + var idArticleHome = '103358'; | |
14 | 13 | var _savedAbstract = null; |
15 | 14 | |
16 | 15 | var service = { |
17 | - getList: articlesRest.getList, | |
16 | + apiArticles: api.host + 'articles/', | |
18 | 17 | getHome: getHome, |
19 | 18 | setHomeAbstract: setHomeAbstract, |
20 | 19 | getHomeAbstract: getHomeAbstract |
... | ... | @@ -23,7 +22,11 @@ |
23 | 22 | return service; |
24 | 23 | |
25 | 24 | function getHome () { |
26 | - return articlesRest.get(api.articleId.home, { | |
25 | + return getArticleById(idArticleHome); | |
26 | + } | |
27 | + | |
28 | + function getArticleById (articleId) { | |
29 | + return $http.get(service.apiArticles + articleId, { | |
27 | 30 | private_token: api.token, |
28 | 31 | fields: 'id,children,categories,abstract,title,image,url,setting,position' |
29 | 32 | }); | ... | ... |
src/app/partials/inicio/inicio.controller.js
... | ... | @@ -32,10 +32,10 @@ |
32 | 32 | hideBackground(2000); |
33 | 33 | } |
34 | 34 | |
35 | - vm.ArticleService.getHome().then(function(homeArticle) { | |
36 | - vm.article = homeArticle.article; | |
35 | + vm.ArticleService.getHome().then(function(result) { | |
36 | + vm.article = result.data.article; | |
37 | 37 | }, function(error) { |
38 | - vm.$log.error(error); | |
38 | + vm.$log.error('Error on getHome article.', error); | |
39 | 39 | }); |
40 | 40 | }; |
41 | 41 | ... | ... |
src/app/partials/inicio/inicio.html
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <div class="embed-responsive embed-responsive-16by9"> |
4 | 4 | <div class="js-iframe" ng-show="inicio.content" ng-bind-html="inicio.content"></div> |
5 | 5 | <div class="video-background" ng-click="inicio.showVideo()"> |
6 | - <div class="video-thumbnail" style="background-image:url(/assets/images/youtube-background.webp)"></div> | |
6 | + <div class="video-thumbnail" style="background-image:url(/assets/images/youtube-background.png)"></div> | |
7 | 7 | <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil"> |
8 | 8 | <svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-play-button-bg" d="m .66,37.62 c 0,0 .66,4.70 2.70,6.77 2.58,2.71 5.98,2.63 7.49,2.91 5.43,.52 23.10,.68 23.12,.68 .00,-1.3e-5 14.29,-0.02 23.81,-0.71 1.32,-0.15 4.22,-0.17 6.81,-2.89 2.03,-2.07 2.70,-6.77 2.70,-6.77 0,0 .67,-5.52 .67,-11.04 l 0,-5.17 c 0,-5.52 -0.67,-11.04 -0.67,-11.04 0,0 -0.66,-4.70 -2.70,-6.77 C 62.03,.86 59.13,.84 57.80,.69 48.28,0 34.00,0 34.00,0 33.97,0 19.69,0 10.18,.69 8.85,.84 5.95,.86 3.36,3.58 1.32,5.65 .66,10.35 .66,10.35 c 0,0 -0.55,4.50 -0.66,9.45 l 0,8.36 c .10,4.94 .66,9.45 .66,9.45 z" fill="#1f1f1e" fill-opacity="0.9"></path><path d="m 26.96,13.67 18.37,9.62 -18.37,9.55 -0.00,-19.17 z" fill="#fff"></path><path d="M 45.02,23.46 45.32,23.28 26.96,13.67 43.32,24.34 45.02,23.46 z" fill="#ccc"></path></svg> |
9 | 9 | </button> | ... | ... |
64.1 KB