1

It seems AngularJS has a new binding symbol: <. The documentation mentions < for Components but isn't really clear about Directives.

So two questions:

  1. Is < binding applicable for Directives as well as Components?
  2. When should I use the < binding?

1 Answer 1

1

Is < binding applicable for Directives as well as Components?

Short answer: Yes

Even though < isn't specifically mentioned on the Directives page in the Developer's Guide. It is documented in the Comprehensive Directive API page which is here:

https://docs.angularjs.org/api/ng/service/$compile#-scope-

When should I use the < binding?

You should use the < binding when you want to specify that the Component or Directive doesn't update the parameter object. Basically, you are saying that this parameter is for input to the directive.

Hence, going forward you should probably only use = binding when your Component or Directive intends to update the parameter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.