view controller $scope.$on "watch" function not working...
2014-04-18 01:53:56 GMT
so I have a quick issue with my controller ordering I guess.
I have the following shell page layout...
I have an ng-view template that the routeProvider is loading (account.php) when we hit the url and load ClientController...
I also have an AuthFacotory factory where, once a user logs in and I get data back from my backend (PHP) I broadcast a signal to say we are authenticated
if (phpData.account_type === 'client')
I have the following I guess "watches" both inside the MainController and ClientController
console.log("We caught the broadcast for clientAuthenticated[MainController]");
<-- ClientController -->
console.log("We caught the broadcast for clientAuthenticated[ClientController]");
I am only "catching" the one in the MainController.
Based on the structure being that the ClientController is loaded as part of the view, I m guessing its some sort of a child of the MainController but why is it not "catching" that broadcast?
the weird part is that I have other code in the ClientController and that gets executed but the console.log inside the scope statement is not
I wanted to create a jsfiddle or plunker but I rarely get them working when I try to do it in a non global modular way like real apps are written
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.