It might help you!!
http://www.code-sample.com/2014/11/call-ajax-request-in-angularjs.html

On Monday, October 20, 2014 8:01:01 PM UTC+5:30, Richard Seldon wrote:
>
>
> Must be missing something very obvious here...
>
> I have setup a new $resource declaration in a parent module, eg:
>
>   var MerchantResource = $resource('/api/merchants/:id', {id: '@id'}, {
>       update: {method: 'PUT', isArray: false}
>     });
>
>
> and now in my child module controller I have injected that $resource as a 
> dependency.
>
> I wish to cache the results of the JSON get call in local storage, and for 
> the local storage "key" I'd like it derived from the $resource URL.
>
> But I only have a handle to MerchantResource
>
> So, how do i query this $resource object for the URL that was originally 
> passed to its constructor ?   (/api/merchants in the above example).
>
> Had a quick peek at the source code: 
> https://github.com/angular/angular.js/blob/master/src/ngResource/resource.js#L62
>
> But could not see where the URL gets exposed - it appears to be buried 
> inside Resource, ResourceFactory and config objects which are not exposed 
> by the $resource object directly.
>
> What am I missing here..?
>

-- 
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.

Reply via email to