diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-28 08:37:24 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-28 08:37:24 -0400 |
| commit | d8fea09d65e5207ef8c4fafcddd5fc74a7f7be00 (patch) | |
| tree | 40d9528aa2e694624eec48da4eccec7c95aee057 /www/js/NewsCtrl.js | |
| parent | 776d0d1a52622d5c84411ec3e3d9303ab117a696 (diff) | |
#709 implement native/XHR wrapper, convert all success/error to "then" construct
Diffstat (limited to 'www/js/NewsCtrl.js')
| -rw-r--r-- | www/js/NewsCtrl.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/www/js/NewsCtrl.js b/www/js/NewsCtrl.js index 6be6aa0e..f18722d9 100644 --- a/www/js/NewsCtrl.js +++ b/www/js/NewsCtrl.js @@ -87,16 +87,19 @@ angular.module('zmApp.controllers').controller('zmApp.NewsCtrl', ['$scope', '$ro $scope.newsItems = []; - $http.get(zm.blogUrl, { + $http.get(zm.blogUrl/*, { transformResponse: function (d, h) { var trunc = "])}while(1);</x>"; d = d.substr(trunc.length); return d; } - }) - .success(function (datastr) { + }*/) + .then(function (datastr) { + datastr = datastr.data; + var trunc = "])}while(1);</x>"; + datastr= datastr.substr(trunc.length); // console.log ("DATA:"+data); // var data = JSON.parse(datastr); |
