editing template. migrating to angular.js