bahaaldine / angular-csv-import

Angular component that lets you import and convert CSV file to JSON
MIT License
150 stars 89 forks source link

Do not call callback method when not exists #53

Closed kination closed 7 years ago

kination commented 8 years ago

When callback method is not defined, it calls error log after import.

Error: scope.callback is not a function

I updated to call the method only when it is not null. Please look on.

lbicknese commented 8 years ago

This change will get rid of the error message, but it might be better to change the binding on the attribute. Right now it is using =; it should use &. This resolves the error, even if callback is undefined, and allows the use of functions more in line with angular conventions.

kination commented 8 years ago

@lbicknese good suggestion. @bahaaldine how do you think?

bahaaldine commented 7 years ago

thanks @djKooks