jpilfold / ngx-image-viewer

An image viewer component for Angular 2+
MIT License
49 stars 55 forks source link

add 2-way binding to index and config. add demo to app #7

Closed tmburnell closed 6 years ago

tmburnell commented 6 years ago

This is related to this: https://github.com/jpilfold/ngx-image-viewer/issues/6 There is 2-way binding on index and config.
So now a user can dynamically change the custom buttons based on the active image.

Please run and see demo, let me know if there is anything that would make this more clear.

jpilfold commented 6 years ago

I'm very happy with the changes to image-viewer.component, but less so with the changes to app.component. I feel that the example could probably be simplified. What is it you wanted to achieve with the demo bit-- just showing the change of the button between link / unlink? My original intent for the app.component stuff was just to show a very simple working example

tmburnell commented 6 years ago

Yes I was just trying to show an example of using the binding.
I can rip it out ... and just make it implied knowledge.

Please let me know what you want and i will do it.

jpilfold commented 6 years ago

Yeah, if you could for now, that would be great. Then, in README.md, if you could just update line 39 to show that 2 way binding is available, just something like:

<ngx-image-viewer  [src]="images" [(index)]="idx"></ngx-image-viewer>
tmburnell commented 6 years ago

I remove most of the code on app (demo), are you fine with it now?

jpilfold commented 6 years ago

Thanks, I'll merge and publish