Last active
August 29, 2015 13:59
-
-
Save morenoh149/10493031 to your computer and use it in GitHub Desktop.
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'; | |
var app = angular.module('Txtbinge', ['ionic', 'firebase']); | |
app.run(function($ionicPlatform) { | |
$ionicPlatform.ready(function() { | |
if(window.StatusBar) { | |
StatusBar.styleDefault(); | |
} | |
}); | |
}); | |
app.config(function($stateProvider, $urlRouterProvider) { | |
$stateProvider | |
.state('app', { | |
url: '/app', | |
abstract: true, | |
controller: 'AppController', | |
templateUrl: 'templates/applayout.html' | |
}) | |
.state('app.home', { | |
url: '/home', | |
views: { | |
'centerContent' :{ | |
templateUrl: 'templates/home.html' | |
} | |
} | |
}) | |
.state('app.profile', { | |
url: '/profile', | |
views: { | |
'centerContent' :{ | |
templateUrl: 'templates/profile.html' | |
} | |
} | |
}); | |
$urlRouterProvider.otherwise('/app/home'); | |
}); |
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
<ion-side-menus> | |
<ion-pane ion-side-menu-content> | |
<ion-nav-bar class="bar-dark"> | |
<ion-nav-back-button class="button-icon"> | |
<i class="ion-chevron-left medium"></i> | |
</ion-nav-back-button> | |
</ion-nav-bar> | |
<ion-nav-view name="centerContent" animation="slide-left-right"></ion-nav-view> | |
</ion-pane> | |
<ion-side-menu side="left"> | |
<ion-content> | |
<ul class="list sidebar"> | |
<li class="item menu-close"> | |
<i class="ion-person large"></i> | |
<span><a href="#/app/music">Profile</a></span> | |
</li> | |
<li class="item"> | |
<i class="ion-chatboxes large"></i> | |
<span>Home</span> | |
</li> | |
<li class="item"> | |
<i class="ion-icecream large"></i> | |
<span>Notifications</span> | |
</li> | |
<li class="item"> | |
<i class="ion-ios7-gear large"></i> | |
<span>Settings</span> | |
</li> | |
<li class="item" onclick="window.plugins.socialsharing.share('Message and subject', 'The subject')"> | |
<i class="ion-android-share medium"></i> | |
<span>Invite</span> | |
</li> | |
</ul> | |
</ion-content> | |
</ion-side-menu> | |
</ion-side-menus> |
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.factory('Camera', ['$q', function($q) { | |
function cameraSuccess(imageURI, q) { | |
// hack until cordova 3.5.0 is released | |
if (imageURI.substring(0,21) === 'content://com.android') { | |
var photoSplit=imageURI.split('%3A'); | |
imageURI='content://media/external/images/media/'+photoSplit[1]; | |
} | |
q.resolve(imageURI); | |
} | |
return { | |
getPicture: function() { | |
var q = $q.defer(); | |
navigator.camera.getPicture( function(imageURI) { cammeraSuccess(imageURI, q); }, | |
function(msg) { | |
q.reject(msg); | |
}, { | |
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY | |
}); | |
return q.promise; | |
} | |
}; | |
}]); |
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('AppController', function($scope, $state, Camera) { | |
$scope.newPost = function() { | |
if( navigator.camera ) { | |
Camera.getPicture().then(function(imageURI) { | |
$scope.imagesrc = imageURI; | |
}, function(err) { | |
console.log(err); | |
}); | |
console.log('inside newpost'); | |
console.log($scope.imagesrc); | |
$state.go('app.profile'); | |
} else { | |
console.log('no camera'); | |
} | |
}; | |
}); | |
app.controller('FeedController', function() { | |
}); |
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
<ion-view title="Feed"> | |
<ion-nav-buttons side="left"> | |
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button> | |
</ion-nav-buttons> | |
<ion-nav-buttons side="right"> | |
<button ng-click="newPost()" class="button button-icon icon ion-plus"></button> | |
</ion-nav-buttons> | |
<ion-content class="has-header"> | |
</ion-content> | |
</ion-view> |
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
<ion-content> | |
<h1>Profile!</h1> | |
{{ imagesrc }} | |
</ion-content> |
perrygovier
commented
Apr 11, 2014
I've updated all the files to what I'm currently using. Thanks for the help guys :+1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment