I'm not really comfortable with the way the original code generate these html tags from the controller and inject them to the front end. Ideally controller should only send back the values. But anyway, these are already happening in original code which is not the focus of this pull request.