directive: 目的是給DOM元素添加自定義行為,可以和Component class一樣,實作life cycle hooks:
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5CZ1MWZ0ITNjVGZ2ATOmdjY1EWM0UTYhJjYzE2NxETOw8CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
Can’t bind to ‘cxFocusConfig’ since it isn’t a known property of ‘div’. ("
答案:
you cant use input/output outside component / directive tag
正确做法?
Hello
so it seems the name of selector and input are kept the same ON PURPOSE?
I think for small directives (single responsibility and single input) its simplified usage