Input type="file" This no longer works. (0.9.26 → 0.9.27)


#1

0.9.26 → 0.9.27
This no longer works.

(html)

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    
    <!-- ionic css -->
    <link href="http://code.ionicframework.com/0.9.27/css/ionic.min.css" rel="stylesheet"/>
    <!-- angularjs scripts -->
    <script src="http://code.ionicframework.com/0.9.27/js/ionic.bundle.min.js"></script>

     <input type="file" id="file" style="display:none"/>
     <button class="button icon ion-filing" ng-click="openFileDialog()"> openFileDialog </ button>

(controller)

    $scope.openFileDialog=function() {
        $('#file').trigger("click");
    }

(English studying) from Japan


v0.9.27 Alpha Salamander released - Last before beta!
#2

Can you explain exactly what doesn’t work and perhaps setup a demo?

You really shouldn’t have that jQuery stuff in your controller. What is supposed to have with the “click” is triggered?


#3

Hi!

Here same. Almost same code, and now with ‘salamander’ it doesn’t work anymore.

i’m was using input=“file” to upload images to a restfull server, using ahn directive on controller.

So, .trigger() to pen upload dialog. now the click return nothig.

What the better way to do this on Angular/Ionic?
I really don’t like the ideia to use jquery with my project, but i needed

Thanks!


v0.9.27 Alpha Salamander released - Last before beta!
#4

I’m sorry to have kept you waiting.

I’ve created a demonstration.
Please compare.


(angularjs version 1.2.12)

You can open a file dialog.
You can display the file name.


(ionic version 0.9.26)

You can open a file dialog.
It is not possible to display the file name.


(ionic version 0.9.27)

It is not possible to open a file dialog.
It is not possible to display the file name.


#5

Hi @nobu19711208, for your specific problem try ionic.trigger: http://codepen.io/ajoslin/pen/qwpCB

This will be documented soon.


#6

I was in the directive.
I worked in chrome
Thank you all!
Sayonara.


#7

Thanks for jumping in on this one Andy. I had to idea where to go with this.