0

It appears that $rootScope and $route change. I don't know how to really explain it, but hopefully the following code will clear things up. Any advice on why this happens or how I can go about fixing it would be very helpful.

Controller #1:

app.controller('PostCtrl', [
  '$scope', 'mainAPIService', 'listFeedService', '$location', '$route',     '$routeParams', '$rootScope',
  function ($scope, mainAPIService, listFeedService, $route, $routeParams, $rootScope) {    
    console.log($route)

Output #1:

Jc {$$html5: true, $$protocol: "http", $$host: "company", $$port: 80, $$parse:     function…}
$$absUrl: "http://company/post/943/comments"
$$compose: function (){var     a=Db(this.$$search),b=this.$$hash?"#"+kb(this.$$hash):"";this.$$url=Qb(this.$$path)+   (a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)}
$$hash: ""
$$host: "company"
$$html5: true
$$parse: function (a){var e=na(c,a);if(!y(e))throw S   b("ipthprfx",a,c);Ic(e,this,b);this.$$path||
$$path: "/post/943/comments"
$$port: 80
$$protocol: "http"
$$replace: false
$$rewrite: function (d){var e;if((e=na(b,d))!==r)return d=e,(e=na(a,e))!==r?c+    (na("/",e)||e):b+d;if((e=na(c,d))!==r)return c+e;if(c==d+"/")return c}
$$search: Object
$$url: "/post/943/comments"
__proto__: Object

Controller #2:

app.controller('FeedCtrl', [
'$scope', 'ajaxService',  '$location', '$route', '$routeParams', '$interval',     '$rootScope',
  function ($scope, ajaxService, $location, $route, $routeParams, $interval,     $rootScope) {
    console.log($route)

Output #2:

Object {routes: Object, reload: function}
current: e.extend.e.extend
reload: function (){u=!0;a.$evalAsync(l)}
routes: Object
__proto__: Object
app.js:181
robert
  • 819
  • 1
  • 10
  • 24

0 Answers0