diff --git a/example/toderp/index.html b/example/toderp/index.html index f09d04dcb3..b8fd9c1e7b 100644 --- a/example/toderp/index.html +++ b/example/toderp/index.html @@ -86,6 +86,17 @@

Your Tasks

+
+ + +
+
+ +
diff --git a/example/toderp/js/toderp.js b/example/toderp/js/toderp.js index bc236e2d9a..8cd7848aaa 100644 --- a/example/toderp/js/toderp.js +++ b/example/toderp/js/toderp.js @@ -1,5 +1,7 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate']) +.constant('FIREBASE_URL', 'https://ionic-todo-demo.firebaseio.com/') + .controller('ToderpCtrl', function($scope, $rootScope, AuthService) { $scope.display = { screen: 'splash' @@ -20,8 +22,8 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate']) }; }) -.factory('AuthService', function(angularFireAuth, $rootScope) { - var ref = new Firebase('https://ionic-todo-demo.firebaseio.com/'); +.factory('AuthService', function(angularFireAuth, $rootScope, FIREBASE_URL) { + var ref = new Firebase(FIREBASE_URL); angularFireAuth.initialize(ref, { scope: $rootScope, callback: function(user, err) { @@ -56,6 +58,7 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate']) .controller('LoginCtrl', function($scope, AuthService) { console.log('Created login Ctrl'); + $scope.loginForm = { email: 'max@drifty.com', password: 'test' @@ -69,11 +72,11 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate']) }, function(e) { $scope.loginError = true; }); - } + }; $scope.showSignup = function() { $scope.setScreen('signup'); - } + }; }) .controller('SignupCtrl', function($scope, AuthService) { @@ -83,5 +86,18 @@ angular.module('toderp', ['firebase', 'ngRoute', 'ngAnimate']) }; }) -.controller('TasksCtrl', function($scope) { +.controller('TasksCtrl', function($scope, angularFireCollection, FIREBASE_URL) { + var taskRef = new Firebase(FIREBASE_URL + '/tasks'); + $scope.tasks = angularFireCollection(taskRef); + $scope.addTask = function(task) { + var t = {}; + t = angular.extend({ + id: $scope.user.id + }, task); + + console.log("Adding task:", t); + $scope.tasks.add(t); + + $scope.task = {}; + }; }); diff --git a/scss/ionic/_base.scss b/scss/ionic/_base.scss index ae9af56731..c727721e01 100644 --- a/scss/ionic/_base.scss +++ b/scss/ionic/_base.scss @@ -38,6 +38,7 @@ body { right: 0; bottom: 0; left: 0; + height: auto; overflow: auto; } /* Hack to force all relatively and absolutely positioned elements still render while scrolling