Skip to content

Instantly share code, notes, and snippets.

@binnyg
Last active August 29, 2015 14:16
Show Gist options
  • Save binnyg/8869c2063e7bf7c6eb29 to your computer and use it in GitHub Desktop.
Save binnyg/8869c2063e7bf7c6eb29 to your computer and use it in GitHub Desktop.
formlyConfigProvider.setType({
name: 'fileField',
template: '<input ng-file-select ng-model="model[options.key]" type="file">',
wrapper: ['bootstrapLabel', 'bootstrapHasError']
});
<div ng-class="{'has-error': showError}" class="form-group ng-scope">
<div>
<label class="control-label ng-binding" for="formly_1_fileField_application_2">
Application
*
</label>
<input type="file" ng-model="model[options.key]" ng-file-select="" id="formly_1_fileField_application_2" name="formly_1_fileField_application_2" required="required" class="ng-untouched ng-dirty ng-valid-parse ng-valid ng-valid-required">
</div>
</div>
Error: 'name' getter called on an object that does not implement interface File. equals@http://localhost:8888/bower_components/angular/angular.js:924:15 equals@http://localhost:8888/bower_components/angular/angular.js:910:18 equals@http://localhost:8888/bower_components/angular/angular.js:924:16 $RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8888/bower_components/angular/angular.js:14237:31 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8888/bower_components/angular/angular.js:14506:13 NgModelController</this.$$debounceViewValueCommit@http://localhost:8888/bower_components/angular/angular.js:23263:7 NgModelController</this.$setViewValue@http://localhost:8888/bower_components/angular/angular.js:23235:7 o/<@http://localhost:8888/bower_components/ng-file-upload/angular-file-upload.min.js:2:1428 timeout/timeoutId<@http://localhost:8888/bower_components/angular/angular.js:16223:28 completeOutstandingRequest@http://localhost:8888/bower_components/angular/angular.js:4905:7 Browser/self.defer/timeoutId<@http://localhost:8888/bower_components/angular/angular.js:5285:7
return logFn.apply(console, args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment