experimental port from official angular.js tutorial