Conditional “multiple” attribute in <input type=“file”> with AngularJS

前端 未结 8 2161
感情败类
感情败类 2021-01-11 18:02

I need an upload form field that may or may not allow the user to select more than one file.

I know I can do something like:



        
8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-11 18:16

    Another idea is to use ngShow/ngHide for this. In this demo example input file is show/hide based in param and have a directive for get input value(s) and set in a $scope param.

    Demo using ngShow + directive

提交回复
热议问题