AngularJS directive for viewing and editing a javascript object