Inputfield with JSon data and Jquery
Hello Guys, im working with angularJS, Jquery and Json files...
Here's my Code, the first
<th>{{item.Nummer}}</th> will Display the correct Value -> 90
Here's my Json file
- { "records":[ {"Nummer":"90","Ranking":"3"} ] }
But if i put the
{{item.Nummer}} in the "rel" in the input field, it will not show up the json data.
does anyone know whjy? and how this can work ? i want that my inputfield gets the data from my json file that it can be generated dynamically
- <div class="grid-block wrap align-center" ng-controller="demoController">
- <table>
- <tr ng-repeat="item in names">
- <th>{{item.Nummer}}</th>
-
- <th>{{item.Nummer}}</th>
- <div class="small-6 grid-block align-center"><input class="knob" type="text" data-width="100" data-thickness=".2" rel="22" value="0">
- </div>
- <div class="small-6 grid-block align-center"><input class="knob" type="text" data-width="100" data-thickness=".2" rel="50" value="0">
- </div>
- <div class="small-6 grid-block align-center"><input class="knob" type="text" data-width="100" data-thickness=".2" rel="99" value="0">
- </div>
- <div class="small-6 grid-block align-center"><input class="knob" type="text" data-width="100" data-thickness=".2" rel="60" value="0">
- </div>
- </tr>
- </table>
- </div>
- <script>
and here^s my JS
$('.knob').each(function(){
-
- var myColor = 'rgba(41,100,159,.5)';
- var self = $(this);
-
- self.knob({
- 'fgColor': myColor,
- });
-
- if(self.val() == 0)
- {
- $({value: 0}).animate({value: parseInt(self.attr("rel"))}, {
- duration: 2000,
- easing:'swing',
- step: function()
- {
- self.val(Math.ceil(this.value)).trigger('change');
- self.val(self.val() + '%');
- }
- })
- }
- });
- </script>