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

Angular 1.6 - select fields not updating model #53

Open
tamaserdfalvi opened this issue Aug 21, 2017 · 4 comments
Open

Angular 1.6 - select fields not updating model #53

tamaserdfalvi opened this issue Aug 21, 2017 · 4 comments

Comments

@tamaserdfalvi
Copy link

Hi!
I have a problem updating my project from angular 1.4.x to 1.x (which is 1.6.6 by now). CRS used to work OK, but it stopped updating the model of the fields, while the country selector perfectly updates the state field.
Select boxes works OK when populated manually, populating them with CRS makes this stop working.

<select
    name="countries"
    id="countries"
    class="crs-country"
    data-default-value="{{countryDefault}}"
    data-region-id="states"
    required
    ng-model="forms.card.address.country"
    data-value="shortcode">
<select
    id="states"
    required
    ng-model="forms.card.address.state"
    data-value="shortcode">
@benkeen
Copy link
Member

benkeen commented Aug 23, 2017

Hi @tamaserdfalvi, I'm afraid I'm not sure... so it's functioning fine, just not updating the model? You may want to ask this question on stack overflow, or somewhere where you can get some Angular input. I'm afraid I'm too much up on Angular. :( Sorry about that & good luck.

@rolinger
Copy link

rolinger commented Sep 2, 2017

@tamaserdfalvi - did you get this working yet? I too am trying to deploy this in an angularJS app. Getting empty select boxes.

@rolinger
Copy link

rolinger commented Sep 2, 2017

Found this, a country only angular version: https://www.npmjs.com/package/ng-country-select

@tamaserdfalvi
Copy link
Author

I just wrote my own component instead.
But @rolinger, if you get empty boxes : this is not really related to the problem I've mentioned. I think it's likely to be caused because you :

  • don't know a window.crs.init() at all
  • or you do it before your DOM is ready, try to do that with a bit of a timeout to see if it's working.

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

3 participants