Hi, I got the same problem, i'm not using ng-view, but ui-view (ui-router plugin). I have the same issue, when i try to use the following code to get the current app injector, it always return undefined.
angular.element(document.body).injector(); //return undefined. Until i move the ui-view directive to a separate div, that not together with ng-app, then it work fine. On Tuesday, September 23, 2014 at 12:00:05 PM UTC+8, H.R. wrote: > > It seems like this would be a common thing people try to do. > Unfortunately, I haven’t found anybody posting about this issue on forums. > > Has anyone had this problem? > > Thanks. > > On Friday, September 19, 2014 4:24:26 PM UTC+7, H.R. wrote: >> >> Hello all, >> >> I have been using angular.element(el).injector() to debug my service (as >> factory) from the browser console. This has worked fine. >> >> Yesterday, I decided to split my views using ng-view and the router and >> since then injector() is returning undefined. >> I tried targeting the the element with ng-controller as well as the >> element with ng-app but I still get undefined. >> >> Can anyone help? >> Plunker: http://plnkr.co/edit/lWHSy1Cs1wMgkzZCML2j?p=preview >> >> Thanks. >> > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
