Now the best part is that you're probably fetching this from the database so you could just fetch json from the server and pass that to the model like so:
// main.js
$.getJSON('/person/find/1').then(function(person) {
$scope.person = person
})
The best part of using the Model View paradigm is that you can add models/fields with minimal changes to the code. Just add that to your backend and your view and you're good to go.
0
u/[deleted] Jun 09 '16
[deleted]