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

sm-input two way binding only binding one way #146

Open
ajshapiro opened this issue Dec 18, 2016 · 2 comments
Open

sm-input two way binding only binding one way #146

ajshapiro opened this issue Dec 18, 2016 · 2 comments

Comments

@ajshapiro
Copy link

With the following, the model gets updated when entering text in the input box but the input box contents are never updated either with an initial value or when the model is changed later.

VIEW:
<sm-input type="text" [(model)]="test" class="left labeled fluid" label="Test"></sm-input>

CODE:
this.test = 'Hello';

@alex88
Copy link

alex88 commented Jan 12, 2017

Same here @vladotesanovic any idea?

@grahnj
Copy link

grahnj commented Jun 12, 2017

I haven't looked at the other src code enough -- nor do I have enough experience with angular-- to offer suggestions of a proper fix, but it's fairly evident in looking at the source code for input that "model" was never wired anywhere in the markup. None of the other source code utilizes ngModel, but manually adding [(ngModel)]="model" to my local source .js was the only way I was able to get this to work as I would expect.

The code for 'select' uses model as an input as well, but handles the incoming model via JQuery to set the initially selected value. Perhaps that was the original line of thought here as well?

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