Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexes are not changing #16

Closed
thybak opened this issue Dec 13, 2016 · 6 comments
Closed

Indexes are not changing #16

thybak opened this issue Dec 13, 2016 · 6 comments

Comments

@thybak
Copy link

thybak commented Dec 13, 2016

First of all thank you for your work. I guess that this module is being useful for everybody here.

I have to say that I read your readme carefully before writing this issue. But, although I was able to install this module and I could make changes client-side, these changes are not reflected in my model property, which is an object array. I followed your instructions by using [sortablejs]='-propertyName-' in the template, but it had no use for me. After changing the order of the elements, the array has the elements in the same position of the beginning in the model property, not in the view (where, in fact, they've changed).

Since I found this problem, I tried a workaround by using the SortableJsOptions. However, inside the event functions you don't have the same context of the Angular Component and you can't modify model properties.

I ran out of possibilities here, am I losing something in my reasoning?

@thybak
Copy link
Author

thybak commented Dec 13, 2016

OK, there's no issue at all. The problem is that I'm loading sortablejs before the observable populates the model. This observable is obtained from a webservice call, therefore it is a timing issue I have to solve in my code.

Sorry for the inconvenience of my not issue.

@thybak thybak closed this as completed Dec 13, 2016
@smnbbrv
Copy link
Member

smnbbrv commented Dec 14, 2016

Hi @thybak , it's good that it is solved. However it is going to be solved after ngOnChnages pull request #15 is merged.

@smnbbrv
Copy link
Member

smnbbrv commented Dec 22, 2016

Hi @thybak should be fixed with the latest version

@thybak
Copy link
Author

thybak commented Dec 22, 2016

I'm waiting NPM to release your 1.2.1 version. Once it's published I'll answer you if my original problem can be solved without initializing the array property in the model.

Thank you, @smnbbrv

@smnbbrv
Copy link
Member

smnbbrv commented Dec 22, 2016

Hi @thybak , sorry for delay, now it should be published. Try again, please

@thybak
Copy link
Author

thybak commented Dec 22, 2016

Works like a charm! Good job 👍

Thank you again for your work and the SortableJS team too, @smnbbrv ;)

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

No branches or pull requests

2 participants