Skip to content

Instantly share code, notes, and snippets.

View h4rm's full-sized avatar

Benjamin von Ardenne h4rm

View GitHub Profile
@wedgybo
wedgybo / OpenUrlService.js
Last active January 7, 2016 20:23
AngularJS service to listen for app opens via a custom URL
angular.module('mlz.openurl', [])
.factory('OpenUrlService', ['$log', '$location', '$rootScope', '$ionicHistory', function ($log, $location, $rootScope, $ionicHistory) {
var openUrl = function (url) {
$log.debug('Handling open URL ' + url);
// Stop it from caching the first view as one to return when the app opens
$ionicHistory.nextViewOptions({
historyRoot: true,