Copied to clipboard

Flag this post as spam?

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


  • Erik Thorén 5 posts 25 karma points
    Feb 25, 2014 @ 08:14
    Erik Thorén
    0

    I'm unable to embed the deafult media picker.

    Hi. I'm currently developing a property editor, and I would like to import images via the deafult media picker. I simply can't make it run. I've tried using code from this tutorial and have so far failed to progress. The JS I'm struggling with looks like this:

    angular.module("umbraco") .controller("MotilloSlideshow", function ($scope, assetsService, dialogService) {

        $scope.addNewImage = function () {
            var dialogImg = dialogService.mediaPicker({
                scope: $scope,
                callback: function (data) {
                    $(data.selection).each(function (i, item) {
                        var imagePropVal = imageHelper.getImagePropertyValue({ imageModel: item, scope: $scope });
                        callback(imagePropVal);
                    });
                }
            });
        }
    });
    

    Any help would be greatly appreciated!

    Regards,

    Erik

  • Anders Schmidt 76 posts 207 karma points
    Jun 06, 2014 @ 21:49
    Anders Schmidt
    0

    Hi

    To me this works. Is It imageHelper??

    angular.module("umbraco").controller("editor", function ($scope, assetsService, dialogService, imageHelper) {
            $scope.insertImage = function (target) {
    
                dialogService.mediaPicker({
                    callback: function (data) {
                        var imagePropVal = imageHelper.getImagePropertyValue({ imageModel: data, scope: $scope })
                        addImgElement(imagePropVal, target);
    
                    }
                });
            }
Please Sign in or register to post replies

Write your reply to:

Draft