I’m iterating through a JSON feed which contains 3 types of data - text, images and contacts. Contacts is sub divided into phone numbers, emails, web urls and SMS/text numbers. Each data item is displayed in an ion-item which has the ng-repeat on it. My problem is that for the contacts, the phone numbers, web/email and SMS links, only the text portion of the list item is tappable/clickable, ie you must tap the yellow part below:
I think your best bet is to change the ion-item to a div and place the item class on each anchor tag: codepen
The ion-item adds padding (via the item class) so unless you put the href directly on the ion-item the anchor tag will always have space around it that isn’t clickable.
Thank you for the reply and codepen, I did think of that (in fact I had initially prototyped it in the CSS version of the list) but I think I may need the Javascript tags as the next type of content I want to add is ion-slide-box for an image gallery - maybe I can just drop that into the middle of a CSS list?
The ionItem is more so for attaching the option/delete/reorder buttons. You can mix the JavaScript directives and css components to get the layout you’d like. I am not able to visualize what you mean, is the ion-slide-box an item in your list or is this going to a different view?
Hi thanks for that - I will have a go at re-doing my template tomorrow (nearly home time here in Ireland). I was just looking at the docs, and yes I am not using any of the API functions so should be ok .
The slide box will be part of the normal content on a single view. Basically I have a CMS on a remote server that the client will use to add content - Text, Image (single), Contacts (as discussed above) and yet to be done, image gallery using the slide box. I aim that is looks like the grab below, except that one can swipe to view more images.
So I modified the codepen above to include a slidebox. I’m adding it in the javascript as TYPE: “GALLERY” and then dynamically adding slides based on the images defined. You would have to change this based on the response from your remote server. Let me know if this is what you mean.
I noticed that there was some of my template missing on my original post - I thought I have fixed that with an edit but it’s still missing. I wanted to be able to create heading Items adn Items without a border so had this on my repeat:
Do you mean using i compared to a div or something else? If you mean the complexity of the item, it depends on how many items you will be adding. mostly because you are adding images. There are a lot of posts on performance on the forums, so you’ll have to sift through to find the relevant bits.
Well yes I meant is there any problem in doing what is, I guess, equivalent to something like
<ul>
<i>
<li>Ion item div</li>
</i>
</ul>
Thanks for the link, I will have a look at that. Right now I’m working on the remote server CMS end so will be able to add more test data to the app and see if I have any performance issues. I don’t see the need for more than a few dozen items per view, but there many be many images in each slide box.
Anyway, I have everything working as required now, thanks!