@beer-garden/addons
Version:
Awesome Addons for Angular Schema Form.
53 lines (51 loc) • 1.54 kB
HTML
<div
class="form-group has-feedback {{form.htmlClass}}"
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}"
file-upload-bytes="form"
sf-field-model
sf-changed="form"
ng-model-options="form.ngModelOptions"
>
<label class="{{form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}"
>{{form.title}}</label
>
<input
class="file-upload-field"
ng-hide="true"
type="file"
id="{{key}}"
onchange="angular.element(this).scope().selectedFile()"
/>
<div class="input-group col-xs-12">
<span class="input-group-addon btn btn-default" ng-click="fileInput.click()"
><i class="glyphicon glyphicon-upload"></i
></span>
<input
type="text"
ng-click="fileInput.click()"
class="form-control input-lg"
readonly
placeholder="{{fileName || form.placeholder || 'Upload File'}}"
/>
<span class="input-group-btn">
<button
class="btn btn-info input-lg"
ng-show="hasFile"
type="button"
ng-click="removeFile()"
>
<i class="glyphicon glyphicon-remove"></i> Remove
</button>
<button
class="btn btn-primary input-lg"
ng-click="fileInput.click()"
ng-show="!hasFile"
ng-disabled="form.readonly"
type="button"
>
<i class="glyphicon glyphicon-search"></i> Browse
</button>
</span>
</div>
<div class="help-block" sf-message="form.description"></div>
</div>