-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Conversation
throw an error when developer accidentaly uses interpolation instead of an expression TODO: - try to apply this to other directives - try to apply this genericaly for directives with isolate scope definition - add an error page
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
Just an idea... do you guys like this? Can it be done in a better way? |
Could it be applied automatically to directives that use isolated scope. I.E. In the following scenario:
the compiler would throw if |
mentioned in the TODO already :) I don't think it's too bad, but it halt compilation? It would be more helpful if people could get a full dump of all of the cases in their app where this happens, rather than dealing with one at a time. ..and then there's the issue with arbitrary |
Another thing we could do is perform this assertion in $parse() instead, so that we know it's always applied when an expression is parsed |
I like the idea, but there is an issue when the user changes the interpolation start symbol |
@lgalfaso that can be fixed |
@petebacondarwin that's on the todo list |
@caitp I like the idea of integrating this with $parse |
@IgorMinar what I am aiming at is that |
phase 2: create a blacklist of start/end tokens which would be valid to the expression parser, and prevent people from using them |
I like it. Could belong in |
I explored this more with Igor, and decided not to make changes to The real problem is that There are 5 directives in total that ask for expressions but don't complain when there's interpolation in them. The first 4 aren't worth the fix/refactor imho:
Everything else throws an error that the developer can see in the console (including isolate scopes with a '='). |
what about nginclude? |
@IgorMinar This is because So |
This must have changed since the last time I got burned by this. Thanks for
|
throw an error when developer accidentaly uses interpolation instead of an expression
TODO: