triniwiz / nativescript-plugins

Apache License 2.0
80 stars 50 forks source link

[ImageCacheIt] Pass headers when using `getItem` static method #77

Closed williamjuan027 closed 1 year ago

williamjuan027 commented 3 years ago

When using ImageCacheIt in template, you could pass in a http header via the headers property (as specified in the docs), like this:

<ImageCacheIt 
        [headers]="headers"
        [src]="imageUrl"></ImageCacheIt>

Would it be possible to also pass in the headers property when using the getItem method to load images that require a header?

Perhaps something like this?

ImageCacheIt.getItem(imageUrl, { headers: headers });
triniwiz commented 3 years ago

Yes this should be possible with a little change