Skip to content

Feature(#348): dynamic item type - #362

Closed
matiboy wants to merge 2 commits into
ionic-team:masterfrom
matiboy:348-dynamic-item-type
Closed

matiboy wants to merge 2 commits into
ionic-team:masterfrom
matiboy:348-dynamic-item-type

Conversation

@matiboy

@matiboy matiboy commented Jan 3, 2014

Copy link
Copy Markdown

#348 requests to be able to create dividers dynamically. Using this pull, item-type can be defined in a similar way as ng-class using an angular expression, thus making it possible to change the type dynamically. For example, using the existing Ionic list example, with line 58 as

item ng-repeat="movie in movies" href="#/movie/{{movie.id}}" item-type="{'item-divider': (movie.rating > 7)}"

will result in the list seen in screenshot (all movies that have rating higher than 7 are bold)
screenshot

Note however that this is a breaking change as item-type="item-divider" for example won't work (must be item-type="'item-divider'" again following the same pattern as ng-class).

@mlynch

mlynch commented Jan 7, 2014

Copy link
Copy Markdown
Contributor

@matiboy, I feel like it would make more sense to use ng-class directly on the item instead of tweaking the item type itself, also item-type could be an attribute that involves more complicated child node creation so I don't think it makes sense to dynamically update it like this. I'd also like to not add more stuff to list items that might potentially slow down performance.

For now I'm going to close as I think ng-class approach is better. Thanks!

@mlynch mlynch closed this Jan 7, 2014
@matiboy matiboy mentioned this pull request Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants