You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my Angular app I am using DropzoneJs to upload images in ng-repeater field , everything working fine I can upload images to my server and I can get Json results , But I need to add uploaded image id to angular input value ,
Here my angular code
Dropzone.autoDiscover = false;
var app = angular.module('dropzone', []);
app.directive('dropzone', function() {
return function(scope, element, attrs) {
var config, dropzone;
config = scope[attrs.dropzone];
// create a Dropzone for the element with the given options
dropzone = new Dropzone(element[0], config.options);
// bind the given event handlers
angular.forEach(config.eventHandlers, function(handler, event) {
dropzone.on(event, handler);
});
};
});
angular.module('plunker', ['ui.sortable', 'dropzone']);
angular.module('plunker').controller('MyCtrl', ['$scope', function($scope) {
$scope.inputs = [{
choices: ''
}];
$scope.addInput = function() {
$scope.inputs.push({
choices: ''
});
}
$scope.dropzoneConfig = {
options: {
'url': 'upload.php',
init: function() {
this.on("success", function(file, response) {
var e = JSON.parse(response);
console.log("sent" + e.location);
$scope.inputs.img = e.location;
});
}
},
}
}]);
This discussion was converted from issue #1916 on March 08, 2021 11:28.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
In my Angular app I am using DropzoneJs to upload images in ng-repeater field , everything working fine I can upload images to my server and I can get Json results , But I need to add uploaded image id to angular input value ,
Here my angular code
and here html code;
I tried this;
but not working , here Plunker
Thanks for answers.
All reactions