Just started learning angular and I'm stumped at the moment.
I don't understand how angular accesses DOM data.
In all examples I've seen data is being initialized inside a controller:
phonecatApp.controller('PhoneListCtrl', function ($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.'},
{'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.'},
{'name': 'MOTOROLA XOOM™',
'snippet': 'The Next, Next Generation tablet.'}
];
});
What if I have a table that's been filled from another source for example.
<table>
<tr>
<td> John </td>
<td> johnson </td>
<td> 30 </td>
</tr>
<tr>
<td> David </td>
<td> Davidson </td>
<td> 23 </td>
</tr>
...
</table>
Let's say I want to do something with those table rows (filter some of them, for example) when a user clicks a certain button. How do I get all the data that's in a table in my controller.
I could apply a filter on a repeater like in the tutorial
<li ng-repeat="phone in phones | filter:query">
{{phone.name}}
<p>{{phone.snippet}}</p>
</li>
but I don't load data from a controller like the tutorial does. In my case it's already there. I just need to get it for manipulation. How?