Copied to clipboard

Flag this post as spam?

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


  • Carlos Casalicchio 177 posts 738 karma points
    May 19, 2016 @ 15:04
    Carlos Casalicchio
    0

    Backoffice reference Media folder in Angular

    How can I get the Id of a media folder dynamically, using Angular?

    Example

        mediaResource.getChildren(ID) //wanna get the Id dynamically
                    .then(function (contentArray) {
    ...
    }
    

    I'm creating an extension for the Backoffice were I need to list all the images of a specific folder, but I know that once I create it as a package, the Id may be different than what I have now. Hence, I need to figure out how to find that specific folder, getting the id dynamically.

  • Carlos Casalicchio 177 posts 738 karma points
    May 20, 2016 @ 03:16
    Carlos Casalicchio
    1

    Nevermind... I've found an answer using entityResource

    entityResource.search("Social Media Channels Themes", "Media")
            .then(function (mediaArray) {
                var mediaId = mediaArray[0].id;
                mediaResource.getChildren(mediaId)
                    .then(function (contentArray) {
                        angular.forEach(contentArray.items, function (value, key) {
                            this.push(populateTheme(value, key));
                        }, engine.themes);
                    });
            });
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies