fixed bug in infoscreen imageupload

This commit is contained in:
okalintu
2016-10-04 14:34:46 +03:00
parent 024c38be8b
commit b94cc3e056
2 changed files with 3 additions and 2 deletions
@@ -1,7 +1,7 @@
<div ng-controller="infoadmin_image_create" style="margin-top:20px;">
<div class="form-group">
<label>Name:</label>
<input type="text" ng-model="item.name"></input>
<input type="text" ng-model="imagename"></input>
</div>
<div class="form-group">
<input type="file" ngf-select ng-model="img" name="file" required>
@@ -109,9 +109,10 @@ app.controller('infoadmin_abbitem_create', function($scope, $http,ItemList){
app.controller('infoadmin_image_create', ['$scope', 'Upload', '$timeout',"ItemList", function ($scope, Upload, $timeout,ItemList) {
$scope.send = function(file) {
console.log("name: "+$scope.imagename);
file.upload = Upload.upload({
url: '/infoscreen/create_image',
data: {name: $scope.name, image: file},
data: {name: $scope.imagename, image: file},
}).then(function (response) {
$timeout(function () {
file.result = response.data;