meteoric / meteor-ionic

Ionic components for Meteor. No Angular!
http://meteoric.github.io
MIT License
1.51k stars 219 forks source link

data-action on ionItem content block #358

Closed gentunian closed 8 years ago

gentunian commented 8 years ago

Hi!

I wanted to move my HTML code into Blaze Spacebars code.

I had this HTML template:

    <template name="actionSheetLogin">
        <div class="list">
            <div class="item item-icon-right" data-action="loginAction">
                Log in {{> ionIcon icon="log-in"}}
            </div>
        </div>
    </template>

And I wanted to translate it to:

    <template name="actionSheetLogin">
        {{#ionList}}
            {{#ionItem iconRight=true data-action="loginAction"}}
                Log in {{> ionIcon icon="log-in"}}
            {{/ionItem}}
        {{/ionList}}
    </template>

But the generated HTML does not include data-action as tag parameter for the div:

<div class="list">
    <div class="item item-icon-right">
        Log in <i class="icon ion-log-in"></i>
    </div>
</div>

I think this could be solved by adding a helper to ionItem template that returns all the data arguments the user can pass into the content block.

My question is: Is this a design decision? Is it just bad to pass arbitrary data into the content blocks?

Cheers!

aesmon commented 8 years ago

I believe the design goal was translating what's in the Ionic framework and the core most important features. Since this package is no longer maintained I would simply create a local copy and modify it to your liking. That is what I am doing right now and had to fix a lot of issues with keyboard/input on top of adding my own features to these items. I don't see anything wrong with that, I am passing a data-action argument to my ionItem template to open actionSheet which I extended to show user profile.

gentunian commented 8 years ago

Hey @aesmon , I agree, this is no longer maintained and I didn't realize that.