Issue
I have read a lot of articles explaining the difference between @
, =
and &
. I've seen a lot of people using =?
in their code. What does this mean?
Unfortunately, I can't seem to search on Google or SO for an answer because search engines ignore special characters.
Solution
The ?
makes the property optional. Otherwise, you'll get NON_ASSIGNABLE_MODEL_EXPRESSION
where Angular is looking for a property that doesn't exist.
From the docs:
If the parent scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You can avoid this behavior using =? or =?attr in order to flag the property as optional.
https://docs.angularjs.org/api/ng/service/$compile#-scope-
Answered By - SomeKittens
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.