Which works really well! However, when the user clicks a button I am going off to an external web service. Grabbing about 6 images, downloading, adding to the media and then returning the Id's.
But I want to refresh the media picker 'view' to show these images have been picked straight away (Like it does in Umbraco when you pick an image from the dialogue normally).
Currently it saves, but the user has to close and then re-opon the dialogue to see the picked images.
Any idea how I trigger/force the media picker to show them straight away?
I can't tell from your code, but there is a chance that you might do something outside of the Angular event system (eg. if using jQuery for your call), and changes to your model won't appear immediately then.
If that is the case, you can look a bit into $scope.$apply() (which sorta forces your view to update). Or you can post a bit more of your code here, I can have another look at it ;)
Thanks chaps for the replies. I actually cheated in the end.... I just called the same method again above and in the 'then' method populated the object with the new values and it works fine :)
Manually Populating Media Picker In Custom Angular View
I have a custom angular controller/view which opens up the side dialogue and renders my Html.
Within this custom view, I am rendering a Multiple Media Picker datatype using
Which works really well! However, when the user clicks a button I am going off to an external web service. Grabbing about 6 images, downloading, adding to the media and then returning the Id's.
I am then setting the value like so
But I want to refresh the media picker 'view' to show these images have been picked straight away (Like it does in Umbraco when you pick an image from the dialogue normally).
Currently it saves, but the user has to close and then re-opon the dialogue to see the picked images.
Any idea how I trigger/force the media picker to show them straight away?
Anyone??
Do you have some more code to show?
I can't tell from your code, but there is a chance that you might do something outside of the Angular event system (eg. if using jQuery for your call), and changes to your model won't appear immediately then.
If that is the case, you can look a bit into
$scope.$apply()
(which sorta forces your view to update). Or you can post a bit more of your code here, I can have another look at it ;)Are you using $watch on the returned values to see when they're updated? Would need more code to analyse and help further? J
Thanks chaps for the replies. I actually cheated in the end.... I just called the same method again above and in the 'then' method populated the object with the new values and it works fine :)
is working on a reply...