Hello, I am new to working with Angular JS. I have been experimenting with a login form that includes a file upload field for the user picture. The input field code looks like this:
<input type="file" file-model="userPic"/>
When I submit the form in the controller.js file and use console.log(userPic)
, I can see the file name, size, and modified date. However, I am looking to also retrieve the width and height dimensions of the uploaded picture before submitting the form. I do have jQuery installed as a bower component, and there is a dimensions.js file within it. Could that be useful for this task?
I attempted to use .width()
to log the width of the input element by slightly modifying the HTML code to include an ID:
<input type="file" file-model="userPic" id="userId"/>
Then, in the controller.js file on form submission, I tried:
console.log($('#userId').width());
However, the output I received was not correct. Can you suggest how I should proceed from here?