ng-options or ng-repeat would transparently handle building the DOM for you if the XHR fetch updates the groups list in the scope.  Keep in mind that if the groups are displayed in a Chosen widget, you may need to trigger the "chosen:updated" event on the widget when the list changes.