This pretty much sums up the problem:
http://jsfiddle.net/gary_h/tuycdmrr/


On Tuesday, September 16, 2014 5:21:58 PM UTC+3, Gordon Bockus wrote:
>
> Just a shot in the dark here but one option would be to data bind  the 
> checked attribute of you jquery checkbox to the model value tracking your 
> value.  
>
> checked={{myModel.thisCheckbox.checked}}
>
> A plunkr would be nice if that doesn't work.
>
> Gordon
>
> On Monday, September 15, 2014 10:41:42 PM UTC-5, [email protected] wrote:
>>
>> Hi,
>>
>> I'm a newbie to Angular, hope you can help me out.
>>
>> When using Jquery mobile chebox with ng-model clicking the checkbox 
>> updates the model value.
>> But updating the model value does not alter the checkbox and I find that 
>> I need extra DOM manipulation code to achieve this like:
>>
>> if ($scope.model_value)
>>      $('#checkbox_id').prop("checked", true).checkboxradio('refresh');
>>             else
>>       $('#checkbox_id').prop("checked", false).checkboxradio('refresh');;
>>
>> Now writing this code inside the controller sort of breaks MVC so how can 
>> achieve this with the framework?
>> My initial thought was to somehow subclass ng-model to include the extra 
>> manipulations
>> or to define another custom directive which hooks to ng-model watching 
>> the model value and performing the work.
>>
>> Afraid I don't know to implement these. How would you go about it?
>>
>> Thanks,
>>
>> Gary
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to