# (developers) ansible-commander UI moving along ... anyone want to wire up REST object listing to the Angular models?

**URL:** <https://forum.ansible.com/t/developers-ansible-commander-ui-moving-along-anyone-want-to-wire-up-rest-object-listing-to-the-angular-models/11901>\
**Category:** Ansible Project\
**Created:** [September 17, 2012, 12:13am UTC](https://forum.ansible.com/t/developers-ansible-commander-ui-moving-along-anyone-want-to-wire-up-rest-object-listing-to-the-angular-models/11901 "2012-09-17T00:13:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 17, 2012, 12:13am UTC](https://forum.ansible.com/t/developers-ansible-commander-ui-moving-along-anyone-want-to-wire-up-rest-object-listing-to-the-angular-models/11901/1 "2012-09-17T00:13:51Z")

</div>

Wow, this is going pretty quick. I am tremendously impressed with  
how easy Bootstrap is making things, and I've made some ground in  
setting up Angular.

I've got some basic list components set up with angular, and this  
should be a good opportunity for someone to dive in and see where  
things are going.  
I certainly don't want to hog all of the fun!

Need a bit of help here if someone wants a crack at it, otherwise I'll  
have to poke around some later. Here's my question/problem at this  
particular stopping point:

When we click on the "users" button, my goal is to load the users  
collection. When we click on "groups", it should load groups. Easy  
enough.

Basically I think I want to do something like:

api\_call('/api/users', 'GET', function(data) {  
&nbsp;&nbsp;&nbsp;&nbsp;data = JSON.parse(data)  
&nbsp;&nbsp;&nbsp;&nbsp;# update the angular model ...  
})

But I'm a little stuck on how to do that.

Basically I need some way to update the data binding when the  
load\_users() function is called, without going through a lot of hoops.  
&nbsp;&nbsp;When you click "users"  
the users should show up. When you click "groups", the names of the  
groups show up with the latest groups, etc.

You'll see I think the listing code can be pretty generic between all  
of the types of objects -- and the code to edit will involve custom  
things.

It seems that I can't simply do "$scope.items = " because "$scope"  
isn't, well, in scope.

If you take a look at the code I also have some stub functions in  
place that will pop up a modal for editing and deleting an object --  
but they are not in place yet.

Anyway, help \*MUCH\* appreciated -- if you want to totally overhaul any  
stupid things I've done that is also welcome, especially if you take  
great offense at my Javascript  
practices 🙂

--Michael
