convert template to angularjs