0

I want to set models which are created dynamically by JQuery. I found a sample here with $compile, But in my case, I don't have access to those created elements at their creating time as those elements are created by a third party plugin (Like JQuery UI s). I have access only to their ID s.

So is there a way to set models to such elements. (I use jquery 1.3)

Here is an sample: Assume I am using the slider of Jquery as mentioned here . #slider is only the div in our accessible layout. Rest of elements are created by the JQuery UI.

<script>
  $(function() {
    $( "#slider" ).slider();
  });
  </script>
</head><body> 
<div id="slider"></div> 
</body>

The sliding gadget is created with a span,

<span class="ui-slider-handle ui-state-default ui-corner-all" tabindex="0" style="left: 9%;"></span>  

This span is created by jquery dynamically. In this case, I want to set a angular model to this <span> ?

Community
  • 1
  • 1
Débora
  • 5,816
  • 28
  • 99
  • 171
  • Please provide some code. The jQuery models, the controller and the view. – David Barker Jan 29 '15 at 09:57
  • @DavidBarker. Thanks for your prompt reply. I modified my question with exact sample. – Débora Jan 29 '15 at 10:21
  • Might want to simply use and angular ready slider. http://angular-ui.github.io/ui-slider/demo/demo.html Angular UI often have most UI stuff made from jQuery and others as angular module so it's all done the angular way and support ng-model by default. Also it means it's often possible to build everything without needed the full jQuery. – GillesC Jan 29 '15 at 10:29
  • @gillesc. Thanks for you answer. But thing is, what if there are more plugins if already set to page ? I will have to move all plugins to angular .. :( . Isn't there any other way ? – Débora Jan 29 '15 at 10:59

0 Answers0