If the directive is added to something other than a file input, it adds
file input elements to the document body. Since these are outside of the
element the directive is applied to, they aren't automatically removed at
the end of its life.
The cleanup code for these elements already existed, but it was only being called
once when the directive was first applied, and wasn't actually removing anything. Now it
will be called on $destroy, and the file elements are correctly removed
If the directive is added to something other than a file input, it adds file input elements to the document body. Since these are outside of the element the directive is applied to, they aren't automatically removed at the end of its life.
The cleanup code for these elements already existed, but it was only being called once when the directive was first applied, and wasn't actually removing anything. Now it will be called on $destroy, and the file elements are correctly removed