2016-05-03 18 views
0

我正在使用ng-file-upload指令來上傳文件。我有一個場景,其中要上傳的文件數量是動態決定的。另外,我創建了一個稍微偏離了上下文和標準提交按鈕的標準,其中「上傳」和「提交」按鈕是分開的,不用說做不同的操作。
現在我想要做的是得到選擇文件ie。 <input type="file">上傳按鈕在同一行上,但我還沒有能夠這樣做。如何獲得選擇文件和另一個按鈕在同一行上?

我的相關標記:

<input type="file" ngf-select ng-model="input.value" name="{{input.name}}" ngf-model-invalid="errorFile" required> 
<button type="button" ng-show="input.value !== null" ng-click="uploadFile(input.value, $index)">Upload File</button> 
<span ng-show="input.value.progress >= 0"> 
    <div class="progress" style="width:{{input.value.progress}}%" ng-bind="input.value.progress + '%'"></div> 
</span> 

我能在這種情況下怎麼辦?

+0

你想點擊該按鈕,打開文件輸入? –

+0

不,另一個按鈕用於調用上傳文件的'uploadFile()',而不是使用Submit按鈕上傳文件。 – theHeman

回答

0

您可以嘗試浮動,右邊的按鈕(see here) 像這樣:

<style type="text/css"> 
    div.inline { float:left; } 
    .clearBoth { clear:both; } 
</style> 

,並在年底明確浮球隨類clearBoth

+0

我無法打開鏈接 – theHeman

相關問題