ngImgCrop icon indicating copy to clipboard operation
ngImgCrop copied to clipboard

Multiple Directive Collision

Open brandonidas opened this issue 10 years ago • 2 comments

Hello,

I'm trying to use ngImgCrop in my MEAN.js stack.

However Angular seems to be blocking me due to "Error: [$compile:multidir] Multiple directives [image, imgCrop] asking for new/isolated scope on: "

I've doubled checked that the dependency is working and I'm using the exact same code for as per the example in the demo for the html and I pasted the code from the example controller into an existing controller.

'use strict';

angular.module('users').controller('ProfilePicUploadController', ['$scope','$location', 'Users', 'Authentication',
    function($scope, $location, Users, Authentication) {
        //This is some other stuff
        $scope.user = Authentication.user;
        if (!$scope.user) $location.path('/');

        //This is the exact code as in the demo
        $scope.myImage='';
        $scope.myCroppedImage='';

        var handleFileSelect=function(evt) {
            var file=evt.currentTarget.files[0];
            var reader = new FileReader();
            reader.onload = function (evt) {
                $scope.$apply(function($scope){
                    $scope.myImage=evt.target.result;
                });
            };
            reader.readAsDataURL(file);
        };
        angular.element(document.querySelector('#fileInput')).on('change',handleFileSelect);
}]);

And here's the html code

"

upload your profile picture

Select an image file:
Cropped Image:

"

Can anyone help me with this directive error?

brandonidas avatar Jan 28 '15 04:01 brandonidas

+1

tairezzzz avatar Mar 31 '15 20:03 tairezzzz

@brandonidas A long short but, did you ever fixed/found out what the problem was ?

elpddev avatar Feb 04 '17 13:02 elpddev