Got it. Looks like you don't need to resolve the file yourself. The following works for me.
dialogService.mediaPicker({
callback: function (data) {
var id = data.id;
mediaResource.getById(id)
.then(function (item) {
var media = mediaHelper.getImagePropertyValue({ mediaModel: item, scope: $scope });
// do thing with media
});
}
});
imageHelper deprecated? what to use instead?
It looks like imageHelper has been deprecated.
https://github.com/umbraco/Umbraco-CMS/blob/d50e49ad37fd5ca7bad2fd6e8fc994f3408ae70c/src/Umbraco.Web.UI.Client/src/common/services/imagehelper.service.js
What should we be using instead?
Cheers
Pete
Hi Pete,
Looks like mediaHelper replaces it, based on this commit:
https://github.com/umbraco/Umbraco-CMS/commit/bf5bb8bc7028939919e3394a7cd111957b83a39a
Thanks,
Tom
Thanks Tom.
Given that every call in imageHelper is a simple wrapper around mediaHelper, I feel pretty daft for missing that. :)
Now I just need to figure out how to use a media item id to get the url or the image. I'm using the following:
But media is always an empty string.
Cheers
Pete
Got it. Looks like you don't need to resolve the file yourself. The following works for me.
is working on a reply...