| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- app=angular.module('app', []);
- app.controller('main', function($scope,$http) {
- $scope.news=[];
- $scope.getNews = function() {
- $http.get("/news/").then(
- function(data) {
- /*
- data.data=data.data.map(function(el) {
- if (el.STATUS!="DISCONNECTED")
- el.STATUS=el.STATUS+" "+el.ELAPSED;
- return el;
- });
- */
- $scope.news=data.data;
- },
- function(data){
- console.log("error");
- console.log(data);
- });
- }
- $scope.getNews();
- /*
- $scope.download = function(book) {
- $http.post("/test/?adasasd",{"type":"BOOK","book":book}).then(
- function(data) {
- $scope.getList();
- },
- function(data){
- console.log("error");
- console.log(data);
- });
- };
- $scope.searchBook = function(book,extension){
- $http.post("/test/?ewqewqewq", {"type":"search","book":book,"extension":extension}).then(
- function(data) {
- console.log("success");
- $scope.getList();
- },
- function(data){
- console.log("err");
- });
- };
- */
- });
|