-
Notifications
You must be signed in to change notification settings - Fork 127
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
working with angularjs #17
Comments
Try using the |
Can you please explain more about this because I think i tried this one already |
There's some discussion on how to handle ng-model changes in the original Semantic UI PR thread, from this comment onwards: Semantic-Org/Semantic-UI#3256 (comment) |
I'm sorry mdehoog but this solution for angularjs2 , how should i fix this for angular 1 |
Hi @mdehoog , I have been trying to use onChange function but I have not been able to set a variable value once a change is detected (maybe onChange is not being called at all). Here is the por tion of the code defining the elements and their settings:
And here is the html code for #rangeend and #rangestart:
The settings type, firstDayOfWeek and start/end Calendar work, but for some reason onChange doesn't have any effect changing the value of the variables. Do you have any idea about how to find a solution/debug the problem? I am using angular 1.x. Thanks [Update] After some trial and error I found that onChange works. Apparently the problem is that since I am using data loaded with angular and this jquery component, some items (data or elements) are loaded in such a way that the data don't flow as expected. For example bringing data from a variable ( loaded from db to the JS controller) to a calendar input: there is a delay when loading a variable in the JS controller from database, a case can appear when the jquery element is ready and the data is not available yet. I suspect there are many things I don't know about how view/content loading works for Angular/jquery or even JS in general. Any guidance in this regard would be highly appreciated. |
I made Angular2 component that works with ngModel. Hope this one help somebody. |
@icepeng thanks for sharing the Angular 2 component. Life saver. I noticed that the value was not displayed on the input after losing focus on the calendar even though it bound to the model. However, changing this
to
displays the value in the input field, howbeit formatted differently. |
@dipolediamond I assume that input value has
This should work, I will update gist after testing. |
but how to do these work in angularjs, i have same problem in semantic ui calendar.. it can not find to ng-model |
ng-model Can't catch changes using basic
$('#rangestart').calendar({ type: 'date', endCalendar: $('#rangeend') }); $('#rangeend').calendar({ type: 'date', startCalendar: $('#rangestart') });
The text was updated successfully, but these errors were encountered: