migrating form templating from python to angularjs