Comments (5)
Привет.
Передавать загрузчикам параметр scope
https://github.com/nervgh/angular-file-upload/blob/master/examples/without-bootstrap/controllers.js#L9
from angular-file-upload.
Я передаю $scope? но всё равно то же самое
$scope.report.candidates[0].uploader = window.uploader = $fileUploader.create(
scope: $scope
url: "/fapi/v1/reports/candidate_photos.json"
isHTML5: true
)
from angular-file-upload.
from angular-file-upload.
Я видел этот вопрос, в нём вы обсуждаете созание двух uploader, для этого создаётся два контроллера. В моём случаи динамическое количество объектов, для них же мне не создать классы. Я делаю примерно так:
@ReportNewCtrl = ($scope, $location, $http, $fileUploader) ->
candidates:[
{uplader: $fileUploader.create(...)},
{uplader: $fileUploader.create(...)},
...
{uplader: $fileUploader.create(...)}
]
Каждый create выглядит так:
$fileUploader.create(
scope: $scope
url: "/fapi/v1/reports/candidate_photos.json"
isHTML5: true
)
затем с помощью ngRepeat вывожу все формы загрузки и если я загружаю картинку в одну форму, то она появляется во всех. Не могу понять как избежать этого, с обычными инпутами нет таких проблем.
from angular-file-upload.
$scope
должны быть разные. Т.е. один загрузчик - одна область видимости.
Уверены, что вам необходимо столько экземпляров загрузчика?
Если ответ положительный, можете написать директиву, которая будет создавать скопы, внутри которых будут загрузчики.
from angular-file-upload.
Related Issues (20)
- angular is not defined HOT 1
- Unable to upload file from Angular 7/8 and backend Spring security project HOT 2
- Callback when no file was valid HOT 3
- timeout HOT 1
- Calling a upload function on button click instead of image upload. HOT 1
- Rename file upload "choose file"
- onAfterAddingFile callback not firing without code change HOT 1
- Rename file according to input name HOT 2
- Bug in IE setting xhr.timeout before xhr.open() in version 2.6.0 HOT 4
- ngf-thumbnail is breaking image orientation HOT 2
- Question: clearing the input.value property to circumvent a bug in chrome
- Drag and Drop not working in Chrome occasionally HOT 2
- "Unsupported Media Type", message: "Content type 'application/octet-stream' not supported"
- Get real path File before upload
- angular1 single item does not add formdata HOT 1
- When I send a file single file use sample code, ,i got a page reload
- Sabuj gazi
- Adding an image captured via camera HOT 1
- How do you post the file data to ASP.Net HOT 1
- How to Costume Header HTTP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-file-upload.