mirroring angular.js code structure