自动focus的directive会在ngAfterViewInit里调用不含输入参数的handleFocus:

autofocus 的directive AfterViewInit里会handleFocus:

先执行子类LockFocus的handleFocus:


再执行父类的handleEvent,里面将focus信息写入内存的map里:

focusDirective使用时没有传optional的group也不要紧,使用默认的g:

group为key,focus Directive的key为map的value.
更多Jerry的原创文章,尽在:"汪子熙":

网友评论