فهرست منبع

Working on hooking up new ionic view to fetch data from Django JSON response

David Leonard 10 سال پیش
والد
کامیت
edc93c7b21
2فایلهای تغییر یافته به همراه13 افزوده شده و 31 حذف شده
  1. 12 30
      ionic/www/js/controllers.js
  2. 1 1
      ionic/www/templates/menu.html

+ 12 - 30
ionic/www/js/controllers.js

@@ -1,42 +1,24 @@
 angular.module('starter.controllers', ['starter.services'])
 
 .controller('AppCtrl', function($scope, $ionicModal, $timeout) {
-  // Form data for the login modal
-  $scope.loginData = {};
-
-  // Create the login modal that we will use later
-  $ionicModal.fromTemplateUrl('templates/login.html', {
-    scope: $scope
-  }).then(function(modal) {
-    $scope.modal = modal;
-  });
-
-  // Triggered in the login modal to close it
-  $scope.closeLogin = function() {
-    $scope.modal.hide();
-  };
-
-  // Open the login modal
-  $scope.login = function() {
-    $scope.modal.show();
-  };
-
-  // Perform the login action when the user submits the login form
-  $scope.doLogin = function() {
-    console.log('Doing login', $scope.loginData);
-
-    // Simulate a login delay. Remove this and replace with your login
-    // code if using a login system
-    $timeout(function() {
-      $scope.closeLogin();
-    }, 1000);
-  };
+
 })
 
 .controller('SessionsCtrl', function($scope, Session) {
     $scope.sessions = Session.query();
+    console.log($scope.sessions);
 })
 
 .controller('SessionCtrl', function($scope, $stateParams, Session) {
     $scope.session = Session.get({sessionId: $stateParams.sessionId});
 });
+
+
+/* 
+
+.controller('SessionsCtrl', function($scope, Session) {
+    $scope.sessions = Session.get();
+    console.log($scope.sessions);
+})
+
+*/

+ 1 - 1
ionic/www/templates/menu.html

@@ -14,7 +14,7 @@
 
   <ion-side-menu side="left">
     <ion-header-bar class="bar-stable">
-      <h1 class="title">Applications</h1>
+      <h1 class="title">Left</h1>
     </ion-header-bar>
     <ion-content>
       <ion-list>