Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-chips not working inside ng-repeat #3482

Closed
cnjsstong opened this issue Jun 26, 2015 · 5 comments
Closed

md-chips not working inside ng-repeat #3482

cnjsstong opened this issue Jun 26, 2015 · 5 comments
Assignees
Milestone

Comments

@cnjsstong
Copy link

Example here:
http://codepen.io/anon/pen/PqEZpa

If a md-chips is inside of any ng-repeat, it will not work properly. Only the last repeated item has its md-chips shown normally.

This makes md-chips barely useful...

@ahmadhsalim
Copy link

I'm having the same trouble. The following code doesn't work.

<md-chips>
      <md-chip ng-repeat="i in [1, 2, 3]">Normal Static Chip</md-chip>
</md-chips>

But weird thing is that, I have the below code in a page and the ng-repeat is populated from an array in scope. No chips are shown. Then I navigate to another page and press the browsers back button. Suddenly all the chips are displayed properly.

@dmackerman
Copy link

You can bind md-chips to an ng-model array and it will populate, but yeah - it's totally broken with `ngRepeat. :(

@cnjsstong
Copy link
Author

@dmackerman Thanks.

Actually, @ahmadhsalim 's issue can have a workaround with ng-model.

However, my example is also quite common but can not be achieved now.

@ahmadhsalim
Copy link

How can I use a workaround? What I want is static chips that cannot be edited. With ng-model bound to an array, it's not giving me static chips.

@cnjsstong
Copy link
Author

@ahmadhsalim Just make the chips readonly in addition. Please go to #2829 which is the correct issue for you.

@ThomasBurleson ThomasBurleson modified the milestone: 0.11.0 Jul 6, 2015
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
topherfangio added a commit that referenced this issue Aug 13, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes #2841, fixes #3482
kennethcachia pushed a commit to kennethcachia/material that referenced this issue Sep 23, 2015
…llow usage inside ng-repeat.

When an autocomplete was used inside of mdChips with the readonly
attribute set to true, it would throw an erroneous error that
would cause the component to not be properly configured and thus
stop working.

Also, using <md-chips> inside of an ng-repeat would fail. Thanks to
@robertmesserle for the guidance in getting this resolved.

fixes angular#2841, fixes angular#3482. closes angular#4133.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
7 participants