0

I try to use hypothesis annotation locally and I want to change some function. So I want to know what does these "<", "&" symbols means?

'use strict';

module.exports = {
  controllerAs: 'vm',
  bindings: {
    icon: '<',
    isDisabled: '<',
    label: '<',
    onClick: '&',
  },
  template: require('../templates/annotation-action-button.html'),
};
Dieterg
  • 16,118
  • 3
  • 30
  • 49
inuryyev
  • 143
  • 2
  • 10
  • 1
    Incorrect tag should be angularjs. Link which may help you: http://blog.krawaller.se/posts/dissecting-bindings-in-angularjs/ – Patryk Błaziński Jan 18 '19 at 07:50
  • Possible duplicate of [What is the difference between & vs @ and = in angularJS](https://stackoverflow.com/questions/14908133/what-is-the-difference-between-vs-and-in-angularjs) – Black Mamba Jan 18 '19 at 07:52

1 Answers1

0

These symbols define data binding strategies for an AngularJS directive or component.

  • < symbol denotes one-way (parent ⇒ child) binding. It means that changes made to the passed value that happen in the parent scope are reflected in the child scope but not vice versa. Two-way (parent ⇔ child) binding strategy is denoted by = symbol.
  • & symbol denotes parent execution binding. It provides a possibility to invoke a function in the context of parent scope. Typically it's used to pass a reference to a method defined in the parent scope to a child.

Official documentation for data binding strategies in components can be found here.

antonku
  • 7,377
  • 2
  • 15
  • 21