Suppose there is a hello instruction, which generates a form dom in the ctrlA control. There is an icon on the form to close the form. How to add a function or method to the icon to close or hide the form dom?
给我你的怀抱2017-05-15 16:57:56
Operations on the dom structure are generally performed in instructions, so in the template of the construction instruction, which is the HTML string you construct, directly add functions such as '<form>..<icon ng-click="hideform">...</form>'
这样一旦指令生成表单后我们能够在当前指令的link函数中设置一个scope.hideform=function(){}
functions to control the hiding and display of the form. Scope and attr are needed here. You can get it in the link parameter