Or can the controller of the command obtain element and attribute objects? I want to call the main command controller method in the sub-command and operate focus in the method, but operating element[0].focus() in the controller does not cause the cursor to Positioning, the instruction encapsulates ng-repeat, because the link is executed after the instruction is compiled, so there will be no response if written directly in the link
http://stackoverflow.com/a/24...
The
link method has a fourth parameter, which represents the controller of the current directive or parent directive.
Write this in the command controller:
link in:
You can call methods in the controller directly in the link. On the other hand, if you call the method in link in the controller, you don't know how to operate it. . .