You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
I'm not quite sure how to word this in the summary. What's happening if you define a directive with replace=true and the directive template with say an ng-click="" and then when you use the directive and also use ng-click="" the two values of ng-click get concatenated before being evaluated/parsed. This causes a parse error b/c the two statements are separated by a semicolon;
It seems like the expression from the directive template is always appended to the expression where the directive is used so the semicolon is needed where the directive is used.
The text was updated successfully, but these errors were encountered:
Here's a similar issue, but this one isn't really fixable (if keeping the replace: true): http://jsfiddle.net/ZnSdS/2/
Either 1) the template's ng-show should win out and override the outer ng-show, 2) the outer ng-show should win out since it's defined first, or 3) the outer ng-show and the template's ng-show should be merged into 'f && t' (but that would mean at least one false would cause it to not display - not sure if that's the right approach. And not to mention the compiler would have to know to add the &&).
As a general rule of thumb, I don't use replace: true in directives, including ones that use transclusion, to avoid situations like this. Without replace: true, the outer ng-show always wins out (which actually satisfies both 2 and 3), and I'm ok with that.
I'm not quite sure how to word this in the summary. What's happening if you define a directive with replace=true and the directive template with say an ng-click="" and then when you use the directive and also use ng-click="" the two values of ng-click get concatenated before being evaluated/parsed. This causes a parse error b/c the two statements are separated by a semicolon;
Here's the broken version without the semicolon on the ngClick callback where the directive is used: http://plnkr.co/edit/9M1fCD1NIy8qGmp9e3zQ?p=preview
Here's the working version where the semicolon is added: http://plnkr.co/edit/l7zLT3bwQdCYx6m5gaWe?p=preview
It seems like the expression from the directive template is always appended to the expression where the directive is used so the semicolon is needed where the directive is used.
The text was updated successfully, but these errors were encountered: