This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Todo</title> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<link rel="stylesheet" href="css/ionic.css"> | |
<!-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* The Project factory handles saving and loading projects | |
* from firebase, and also lets us save and load the | |
* last active project index. | |
*/ | |
app.factory('Projects', function($firebase, FIREBASE_URL, $scope) { | |
var ref = new Firebase(FIREBASE_URL + 'projects'); | |
var firebase_projects = $firebase(ref); | |
var keys = firebase_projects.$getIndex(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('todo', ['ionic', 'firebase']) | |
/** | |
* The Projects factory handles saving and loading projects | |
* from localStorage, and also lets us save and load the | |
* last active project index. | |
*/ | |
.factory('Projects', function() { | |
return { | |
all: function () { | |
var projectString = window.localStorage['projects']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div><h1>hello</h1></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div><h1>hi</h1></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('HomeController', function($scope) { | |
$scope.selectedMail; | |
$scope.setSelectedMail = function(mail) { | |
$scope.selectedMail = mail; | |
}; | |
$scope.isSelected = function(mail) { | |
if($scope.selectedMail) { | |
return $scope.selectedMail === mail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module("myApp", ['ngRoute', 'firebase']); | |
app.config(function($routeProvider) { | |
$routeProvider.when('/', { | |
templateUrl: "templates/home.html", | |
controller: "HomeController" | |
}) | |
.when('/settings', { | |
templateUrl: 'templates/settings.html', | |
controller: 'SettingsController' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('todo', ['ionic', 'firebase']) | |
/** | |
* The Projects factory handles saving and loading projects | |
* from localStorage, and also lets us save and load the | |
* last active project index. | |
*/ | |
.factory('Projects', function() { | |
return { | |
all: function () { | |
var projectString = window.localStorage['projects']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
app.controller('TodoCtrl', function($scope, $timeout, $ionicModal, Projects, $firebase, $ionicLoading) { | |
// Load projects | |
var projectsUrl = "https://ionic-guide-harry.firebaseio.com/projects/"; | |
var projectRef = new Firebase(projectsUrl); | |
// query firebase for keys to projects | |
projectRef.on('value', function(snapshot) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.controller('SelectPicCtrl', function($scope, PetService) { | |
$scope.pets = PetService.all(); | |
$scope.launchPhotoLibrary = function() { | |
navigator.camera.getPicture( cameraSuccess, cameraError, | |
{ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY } ); | |
}; | |
function cameraSuccess(imageURI) { | |
$scope.image = document.getElementById('myImage'); | |
$scope.image.src = imageURI; |