fix($compile): reference correct directive name in ctreq error#7067
fix($compile): reference correct directive name in ctreq error#7067caitp wants to merge 1 commit into
Conversation
|
With a bit more testing, it appears that the directive name matters here. If the directive requiring "ngModel" is called "zDir", and the only other directive used is "ngClick", then the correct error message is used, because "zDir" is the last directive referenced. Given that, I'm going to re-word my test case a bit so that it's clear what is actually being tested. |
Previously, ctreq would possibly reference the incorrect directive name, due to relying on a directiveName living outside of the closure which throws the exception, which can change before the call is ever made. This change saves the current value of directiveName as a property of the link function, which prevents this from occurring. Closes angular#7062
|
lgtm |
Previously, ctreq would possibly reference the incorrect directive name, due to relying on a directiveName living outside of the closure which throws the exception, which can change before the call is ever made. This change saves the current value of directiveName as a property of the link function, which prevents this from occurring. Closes #7062 Closes #7067
|
Hey , I am new to angular and facing the same issue but don't know which files to include from your fixes. |
|
@devamir it's in https://code.angularjs.org/1.3.0-beta.6/angular.js and https://code.angularjs.org/1.2.17/angular.js --- but it may not be a fix for the specific issue you're having, the compiler still has some errors that behave weirdly |
|
what is the difference between the conventional angularjs.js which we use and this https://code.angularjs.org/1.2.17/angular.js i think they are one and the same and regarding my issue |
|
What I'm saying is that this patch is included in releases 1.2.17 (which was just released the other day) and 1.3.0-beta.6 (released a while ago) |
|
ohhk got it Thnx @caitp |
Previously, ctreq would possibly reference the incorrect directive name, due to relying on a directiveName living outside of the closure which throws the exception, which can change before the call is ever made.
This change saves the current value of directiveName as a property of the link function, which prevents this from occurring.
Closes #7062
Closes #7059