Guest User

Untitled

a guest
Apr 19th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Ionic Starter App
  2.  
  3. // angular.module is a global place for creating, registering and retrieving Angular modules
  4. // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
  5. // the 2nd parameter is an array of 'requires'
  6. // 'starter.services' is found in services.js
  7. // 'starter.controllers' is found in controllers.js
  8. var app = angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
  9.     .run(function ($ionicPlatform) {
  10.         $ionicPlatform.ready(function () {
  11.             // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
  12.             // for form inputs)
  13.             if (window.cordova && window.cordova.plugins.Keyboard) {
  14.                 cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  15.             }
  16.             if (window.StatusBar) {
  17.                 // org.apache.cordova.statusbar required
  18.                 StatusBar.styleDefault();
  19.             }
  20.         });
  21.     });
  22.  
  23. app.controller("FeedController", function ($http, $scope) {
  24.     $scope.init = function () {
  25.         $http.get("http://ajax.googleapis.com/ajax/services/feed/load", { params: { "v": "1.0", "q": "http://blog.nraboy.com/feed/", "num": "100" } })
  26.         .succes(function (data) {
  27.             $scope.rssTitle = data.responseData.feed.title;
  28.             $scope.entries = data.responseData.feed.entries;
  29.             window.localStorage["entries"] = JSON.stringify(data.responseData.feed.entries);
  30.         })
  31.         .error(function (data) {
  32.             console.log("error" + data);
  33.         });
  34.     };
  35. });
Advertisement
Add Comment
Please, Sign In to add comment