Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

reorder #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions www/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
</head>
<body ng-app="starter" ng-controller="MainCtrl">
<ion-header-bar>
Expand Down
18 changes: 1 addition & 17 deletions www/js/app.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.services'])
angular.module('starter', ['ionic', 'starter.services', 'starter.controllers'])

.config(function($compileProvider){
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
Expand All @@ -20,20 +20,4 @@ angular.module('starter', ['ionic', 'starter.services'])
});
})

.controller('MainCtrl', function($scope, Camera) {

$scope.getPhoto = function() {
Camera.getPicture().then(function(imageURI) {
console.log(imageURI);
$scope.lastPhoto = imageURI;
}, function(err) {
console.err(err);
}, {
quality: 75,
targetWidth: 320,
targetHeight: 320,
saveToPhotoAlbum: false
});
};

})
27 changes: 2 additions & 25 deletions www/js/controllers.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
angular.module('starter.controllers', [])

.config(function($compileProvider){
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
})

.controller('DashCtrl', function($scope) {
})
.controller('MainCtrl', function($scope, Camera) {

.controller('FriendsCtrl', function($scope, Friends, Camera) {
$scope.friends = Friends.all();
$scope.getPhoto = function() {
console.log('Getting camera');
Camera.getPicture().then(function(imageURI) {
console.log(imageURI);
$scope.lastPhoto = imageURI;
Expand All @@ -22,21 +14,6 @@ angular.module('starter.controllers', [])
targetHeight: 320,
saveToPhotoAlbum: false
});
/*
navigator.camera.getPicture(function(imageURI) {
console.log(imageURI);
}, function(err) {
}, {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL
});
*/
}
})
};

.controller('FriendDetailCtrl', function($scope, $stateParams, Friends) {
$scope.friend = Friends.get($stateParams.friendId);
})

.controller('AccountCtrl', function($scope) {
});
25 changes: 0 additions & 25 deletions www/js/services.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,3 @@ angular.module('starter.services', [])
}
}
}])

/**
* A simple example service that returns some data.
*/
.factory('Friends', function() {
// Might use a resource here that returns a JSON array

// Some fake testing data
var friends = [
{ id: 0, name: 'Scruff McGruff' },
{ id: 1, name: 'G.I. Joe' },
{ id: 2, name: 'Miss Frizzle' },
{ id: 3, name: 'Ash Ketchum' }
];

return {
all: function() {
return friends;
},
get: function(friendId) {
// Simple index lookup
return friends[friendId];
}
}
});
10 changes: 0 additions & 10 deletions www/templates/friend-detail.html

This file was deleted.

5 changes: 0 additions & 5 deletions www/templates/tab-account.html

This file was deleted.

5 changes: 0 additions & 5 deletions www/templates/tab-dash.html

This file was deleted.

10 changes: 0 additions & 10 deletions www/templates/tab-friends.html

This file was deleted.

27 changes: 0 additions & 27 deletions www/templates/tabs.html

This file was deleted.