Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paria Shiri 12 posts 76 karma points
    Aug 27, 2021 @ 12:08
    Paria Shiri
    0

    Event listener for MediaPicker

    I am going to use https://our.umbraco.com/Documentation/Reference/Angular/Services/eventsService/ I have a MediaPicker which I get it by its ID this way:

    var x = umbRequestHelper.resourcePromise(
                                       http.get(umbRequestHelper.getApiUrl('mediaApiBaseUrl',
                                       'GetById',
                                        [{ id: 1331}]),
                                        { umbIgnoreErrors: true }
                                        ),
                                            'Failed to retrieve data for media id ' + imageUrl
                                    ).then(function (data) {
                                        for (var d in data) {
                                            console.log(d +' = ' + data[d]);
                                        }
        });
    

    I want to add an event listener to it so when its image changes I can notice. But I don't know what should I do exactly!

    eventsService.emit("editorState.changed", { entity: entity });
    

    what I should send to emit instead of "editorState.changed", { entity: entity } parameters? Is it the right way though?

  • Paria Shiri 12 posts 76 karma points
    Sep 01, 2021 @ 08:07
    Paria Shiri
    0

    nothing?

Please Sign in or register to post replies

Write your reply to:

Draft