get and show travels from server by app
1
app/.io-config.json
Normal file
@@ -0,0 +1 @@
|
||||
{"app_id":"0f46f512"}
|
||||
12
app/comandesUtils.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export ANDROID_HOME=~/Android/Sdk/
|
||||
PATH=$PATH:$ANDROID_HOME/tools
|
||||
PATH=$PATH:$ANDROID_HOME/platform-tools
|
||||
|
||||
|
||||
cd /home/nau/Android/Sdk/tools
|
||||
./android
|
||||
|
||||
|
||||
ionic serve
|
||||
ionic build android
|
||||
@@ -16,7 +16,28 @@
|
||||
<preference name="FadeSplashScreenDuration" value="2000"/>
|
||||
<preference name="android-minSdkVersion" value="16"/>
|
||||
<preference name="BackupWebStorage" value="none"/>
|
||||
<preference name="SplashScreen" value="screen"/>
|
||||
<feature name="StatusBar">
|
||||
<param name="ios-package" value="CDVStatusBar" onload="true"/>
|
||||
</feature>
|
||||
<platform name="android">
|
||||
<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
|
||||
<icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
|
||||
<icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
|
||||
<icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
|
||||
<icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
|
||||
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
|
||||
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
|
||||
</platform>
|
||||
</widget>
|
||||
4
app/ionic.config.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "app",
|
||||
"app_id": "0f46f512"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"name": "app",
|
||||
"app_id": ""
|
||||
"app_id": "0f46f512"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "app",
|
||||
"name": "collectivecar",
|
||||
"version": "1.1.1",
|
||||
"description": "app: An Ionic project",
|
||||
"description": "app: collectivecar",
|
||||
"dependencies": {
|
||||
"gulp": "^3.5.6",
|
||||
"gulp-sass": "^2.0.4",
|
||||
|
||||
BIN
app/resources/android/icon/drawable-hdpi-icon.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/resources/android/icon/drawable-ldpi-icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/resources/android/icon/drawable-mdpi-icon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/resources/android/icon/drawable-xhdpi-icon.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
app/resources/android/icon/drawable-xxhdpi-icon.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
app/resources/android/icon/drawable-xxxhdpi-icon.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/resources/android/splash/drawable-land-hdpi-screen.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/resources/android/splash/drawable-land-ldpi-screen.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/resources/android/splash/drawable-land-mdpi-screen.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
app/resources/android/splash/drawable-land-xhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
app/resources/android/splash/drawable-land-xxhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
app/resources/android/splash/drawable-land-xxxhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
app/resources/android/splash/drawable-port-hdpi-screen.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/resources/android/splash/drawable-port-ldpi-screen.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
app/resources/android/splash/drawable-port-mdpi-screen.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
app/resources/android/splash/drawable-port-xhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
app/resources/android/splash/drawable-port-xxhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
app/resources/android/splash/drawable-port-xxxhdpi-screen.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
app/resources/icon.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
app/resources/ios/icon/icon-40.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/resources/ios/icon/icon-40@2x.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
app/resources/ios/icon/icon-50.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/resources/ios/icon/icon-50@2x.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
app/resources/ios/icon/icon-60.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
app/resources/ios/icon/icon-60@2x.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
app/resources/ios/icon/icon-60@3x.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/resources/ios/icon/icon-72.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/resources/ios/icon/icon-72@2x.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
app/resources/ios/icon/icon-76.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
app/resources/ios/icon/icon-76@2x.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
app/resources/ios/icon/icon-small.png
Normal file
|
After Width: | Height: | Size: 818 B |
BIN
app/resources/ios/icon/icon-small@2x.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
app/resources/ios/icon/icon-small@3x.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/resources/ios/icon/icon.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
app/resources/ios/icon/icon@2x.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
app/resources/ios/splash/Default-568h@2x~iphone.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
app/resources/ios/splash/Default-667h.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
app/resources/ios/splash/Default-736h.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
app/resources/ios/splash/Default-Landscape-736h.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
app/resources/ios/splash/Default-Landscape@2x~ipad.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
app/resources/ios/splash/Default-Landscape~ipad.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/resources/ios/splash/Default-Portrait@2x~ipad.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
app/resources/ios/splash/Default-Portrait~ipad.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/resources/ios/splash/Default@2x~iphone.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/resources/ios/splash/Default~iphone.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
app/resources/splash.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
@@ -42,8 +42,8 @@ angular.module('starter.controllers', [])
|
||||
})
|
||||
|
||||
|
||||
.controller('TravelsCtrl', function($scope) {
|
||||
$scope.travels = [
|
||||
.controller('TravelsCtrl', function($scope, $http) {
|
||||
/*$scope.travels = [
|
||||
{ id: 1, title: 'Travel1', description: "description for travel 1", owner: "user1", icon: "car" },
|
||||
{ id: 2, title: 'Travel2', description: "description for travel 2", owner: "user2", icon: "station-wagon" },
|
||||
{ id: 3, title: 'Travel3', description: "description for travel 3", owner: "user3", icon: "van" },
|
||||
@@ -52,7 +52,20 @@ angular.module('starter.controllers', [])
|
||||
{ id: 6, title: 'Travel6', description: "description for travel 6", owner: "user3", icon: "lorry" },
|
||||
{ id: 7, title: 'Travel7', description: "description for travel 7", owner: "user1", icon: "sport-car" },
|
||||
{ id: 8, title: 'Travel8', description: "description for travel 8", owner: "user2", icon: "jeep" }
|
||||
];
|
||||
];*/
|
||||
$scope.travels="";
|
||||
$http.get('http://localhost:3000/api/travels')
|
||||
.success(function(data, status, headers,config){
|
||||
console.log('data success');
|
||||
console.log(data); // for browser console
|
||||
$scope.travels = data; // for UI
|
||||
})
|
||||
.error(function(data, status, headers,config){
|
||||
console.log('data error');
|
||||
})
|
||||
.then(function(result){
|
||||
travels = result.data;
|
||||
});
|
||||
})
|
||||
.controller('TravelCtrl', function($scope, $stateParams) {
|
||||
//$scope.travel=travels.get($stateParams.travelId);
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
<ion-item menu-close href="#/app/travels">
|
||||
Travels
|
||||
</ion-item>
|
||||
<ion-item menu-close href="#/app/browse">
|
||||
Transport material
|
||||
</ion-item>
|
||||
<ion-item menu-close href="#/app/search">
|
||||
Available cars
|
||||
</ion-item>
|
||||
|
||||
@@ -58,7 +58,8 @@ exports.addTravel = function(req, res) {
|
||||
to: req.body.to,
|
||||
date: req.body.date,
|
||||
generateddate: req.body.generateddate,
|
||||
seats: req.body.seats
|
||||
seats: req.body.seats,
|
||||
icon: req.body.icon
|
||||
});
|
||||
|
||||
travel.save(function(err, travel) {
|
||||
|
||||
@@ -10,6 +10,7 @@ var travelSchema = new Schema({
|
||||
to: { type: String },
|
||||
date: { type: Date },
|
||||
generateddate: { type: Date },
|
||||
seats: { type: Number }
|
||||
seats: { type: Number },
|
||||
icon: { type: String }
|
||||
})
|
||||
module.exports = mongoose.model('travelModel', travelSchema);
|
||||
|
||||