angular.module('RouteService', []).service('Route', function ($timeout, Observer) { var ob = Observer.create(); this.getOb = function () { return ob; }; this.getRoute = function () { return this.route; }; this.setRoute = function (obj, context, notify) { this.route = obj; if (notify !== false) { $timeout(function () { ob.notify(context); }, 0); } }; });