Skip to content

Instantly share code, notes, and snippets.

View morenoh149's full-sized avatar
💭
Working from 🛰

Harry Moreno morenoh149

💭
Working from 🛰
View GitHub Profile
<!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">
<!--
'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();
@morenoh149
morenoh149 / app.js
Created February 27, 2014 09:27
adding firebase to ionic guide
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'];
<div><h1>hello</h1></div>
<div><h1>hi</h1></div>
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;
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'
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'];
'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) {
.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;