Controller and directive for dynamic fom