Created
June 2, 2016 00:28
-
-
Save ajcrites/118e91cc14a2cc5b5039cd2436eb66da to your computer and use it in GitHub Desktop.
This file contains hidden or 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('starter', ['ionic']) | |
.run(["LocationService", async LocationService => { | |
const coords = await LocationService.getPosition(); | |
console.log(coords); | |
}]) | |
.service("LocationService", ["$window", "$q", ($window, $q) => ( | |
{ | |
getPosition() { | |
const dfd = $q.defer(); | |
$window.navigator.geolocation.getCurrentPosition(dfd.resolve, dfd.reject); | |
return dfd.promise; | |
} | |
} | |
)]); |
This file contains hidden or 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
const gulp = require('gulp'); | |
const concat = require('gulp-concat'); | |
const babel = require("gulp-babel"); | |
const paths = { | |
js: ['./www/app/**/*.js'], | |
}; | |
gulp.task('default', ['babel']); | |
gulp.task('babel', () => | |
gulp.src(paths.js) | |
.pipe(babel({ | |
presets: ['es2015'], | |
plugins: ['transform-async-to-generator', 'transform-regenerator'], | |
})) | |
.pipe(concat('app.min.js')) | |
.pipe(gulp.dest('./www/dist/')) | |
); |
This file contains hidden or 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
{ | |
"name": "foo", | |
"version": "1.1.1", | |
"description": "foo: An Ionic project", | |
"devDependencies": { | |
"babel-plugin-transform-async-to-generator": "^6.8.0", | |
"babel-plugin-transform-regenerator": "^6.9.0", | |
"babel-preset-es2015": "^6.9.0", | |
"bower": "^1.3.3", | |
"gulp": "^3.5.6", | |
"gulp-babel": "^6.1.2", | |
"gulp-concat": "^2.6.0" | |
}, | |
"cordovaPlugins": [ | |
"cordova-plugin-device", | |
"cordova-plugin-console", | |
"cordova-plugin-whitelist", | |
"cordova-plugin-splashscreen", | |
"cordova-plugin-statusbar", | |
"ionic-plugin-keyboard" | |
], | |
"cordovaPlatforms": [] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment