angular directive - When and why to use &?, =?, @? in AngularJS? -
i follow tutorials make angular directives. in isolate scope, tutorials define scope like:
scope: { model: '=?', data: '@?' } and tutorials define scope without question mark like:
scope: { model: '=', data: '@' } can explain me difference or purpose of these proper example. thank you.
the &, @, , = symbols used define bindings (one-way, bi-directional, etc) isolated scope objects, know. here pretty thorough tutorial on how works.
the ? symbol used indicate parent scope property isolated scope binding refers optional. means if reason parent scope property doesn't exist, application continue run without throwing non_assignable_model_expression exception.
Comments
Post a Comment