SMH110 / widgets

1 stars 0 forks source link

It would be great if we could have 2 calculators on the same page! #5

Closed massimocode closed 8 years ago

massimocode commented 8 years ago

I often find myself adding opening 2 tabs of this great calculator side by side... but it would be great if you could add a HTML file with 2 on the same page!

SMH110 commented 8 years ago

Done in e2b745eda4424be5fc0ba4cbc828d0aa15643925 but I don't think this is the right way to put two calculator in one page

massimocode commented 8 years ago

It works fine, but it looks like you've duplicated both the calculator code and the html. You could do this without duplicating any code or html.

Your current calculator is using object oriented programming, so you can easily create several independent calculators with new Calculator(). That part will be easy.

For the html, try looking into the knockout foreach binding and binding onto an array of your calculators.

massimocode commented 8 years ago

I will create a separate issue for this.