Reputation: 606
I have the following code and in that, codeValue property is set to '=?'. Please note the question mark after the equal to symbol.
What does '=?' do?
app.directive('questionMark', function () {
return {
restrict: 'E',
scope: {
codeValue: "=?"
},
template: 'Hello world'
};
});
Upvotes: 1
Views: 40
Reputation: 3618
All 4 kinds of bindings (@, =, <, and &) can be made optional by adding ? to the expression.
It marks the parameter as optional. Read more: https://docs.angularjs.org/api/ng/service/$compile
Upvotes: 1