When and why to use & ?, = ?, @? in AngularJS?

I followed some tutorials to create corner directives. In an isolated scope, some textbooks define scope as follows:

scope: {
  model: '=?',
  data:  '@?' 
}

Meanwhile, some textbooks define a sphere without a question mark, like this:

scope: {
  model: '=',
  data:  '@'
}

Can anyone explain me the difference or purpose of this with examples? Thank.

+6
source share
1 answer

Symbols &, @and =are used to define bindings (unidirectional, bidirectional, etc.) for isolated objects of the scope, as you already know. Here's a pretty detailed tutorial on how it all works .

? , , , . , - , NON_ASSIGNABLE_MODEL_EXPRESSION.

+7

Source: https://habr.com/ru/post/1599324/


All Articles