I can not see a reason for doing this but it can be achieved trough getting
hold on main injector. You can query the DOM for (a node inside) angular
root element (the one with ng-app attribute) and wrapping it in an
angular.element(), then you can call the injector() method.
Example:
var $injector = angular.element(document.querySelector('[ng-app]')).injector
();
var $http = $injector.get('$http');
On Sunday, May 3, 2015 at 11:41:37 AM UTC+3, Gaurav Ashara wrote:
>
> Hello All,
>
> I want to access my service object in plain javascript class.
>
> Any buddy did please help me for that.
>
> Thanks & Regards
> Gaurav Ashara
>
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.