ngImgCrop
ngImgCrop copied to clipboard
Multiple Directive Collision
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
Can anyone help me with this directive error?
+1
@brandonidas A long short but, did you ever fixed/found out what the problem was ?