In my code I have several markup items like so:
<div class="sli1"
data-values="10, 20, 30, 40,50, 60, 70"
<div class="sli2"
data-values="20, 40,60, 80,100, 120, 500"
What I have at the moment is a very simple:
sli1 = $('#sli1').attr('data-values')
How can I improve this with Angular models, so I can access the model via either the controller or view?
Edit for abit more code:
In my view where I have:
<div class="sli1"
data-values="...
The values are embedded via the server right into the view, rather than the controller.
In the controller I declare the models on the JS vars:
$scope.new['test1'] = sli1;
$scope.new['test2'] = sli2;
That I can then declare certain points like:
$scope.new['test1'][0]
$scope.new['test1'][1];
$scope.new['test1'][2];
$scope.new['test1'][3];
$scope.new['test1'][4];
To get the array index values, just wondering if I can do it better with angular directly rather than rely on the JS vars.