Skip to content
This repository was archived by the owner on Mar 16, 2023. It is now read-only.

new function prototypes for click/change events #18

Closed
wants to merge 5 commits into from

Conversation

Masterdanielsan
Copy link

No description provided.

User can override AngularEvaporate.$change
and AngularEvaporate.$click with custom functions
@uqee
Copy link
Owner

uqee commented Sep 14, 2016

You propose to just remove everything?) Have a look at Files changed tab.

@Masterdanielsan Masterdanielsan changed the title syncing to recent new function prototypes for click/change events Sep 14, 2016
@uqee
Copy link
Owner

uqee commented Sep 15, 2016

Well, unfortunately that PR shouldn't be merged because it just duplicates an already existing Angular core functionality. The proper way to watch for click and change events would be using the ng-click and ng-change directives respectively (also speaking about your use case and the latter directive, be aware of that issue).

@uqee uqee closed this Sep 15, 2016
@Masterdanielsan
Copy link
Author

Masterdanielsan commented Sep 15, 2016

The ng-click and ng-change directives do not work when added as attributes to the angular-evaporate directive. The change I added seems to work fine.

Can you offer an alternative?

The following DOES NOT work:
<input type="file" style="display:none;" multiple angular-evaporate="ae" **ng-change="previewFiles()"**>

Additionally, I have seen that issue that you linked, but it didn't seem to effect the code I added...

Thoughts?


EDIT: ng-click works fine. ng-change does not work currently. Currently there is no way to register that the input has changed without altering the directive. I believe this change (without the click portion) should go live.

@uqee
Copy link
Owner

uqee commented Sep 15, 2016

As guys discuss it in the issue above, you have to use a native onchange instead of ng-change in case of input[type=file] until it gets fixed in the Angular core (currently work in progress). This functionality has nothing in common with the current directive, so it shouldn't be included.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants