Skip to content

Commit 74123e8

Browse files
committed
refactor($compile): check nodomevents at compile time instead of link
1 parent 66d8b10 commit 74123e8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ng/compile.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -2285,19 +2285,19 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
22852285
startingTag(node));
22862286
}
22872287

2288+
if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
2289+
throw $compileMinErr('nodomevents',
2290+
"Interpolations for HTML DOM event attributes are disallowed. Please use the " +
2291+
"ng- versions (such as ng-click instead of onclick) instead.");
2292+
}
2293+
22882294
directives.push({
22892295
priority: 100,
22902296
compile: function() {
22912297
return {
22922298
pre: function attrInterpolatePreLinkFn(scope, element, attr) {
22932299
var $$observers = (attr.$$observers || (attr.$$observers = {}));
22942300

2295-
if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
2296-
throw $compileMinErr('nodomevents',
2297-
"Interpolations for HTML DOM event attributes are disallowed. Please use the " +
2298-
"ng- versions (such as ng-click instead of onclick) instead.");
2299-
}
2300-
23012301
// If the attribute was removed, then we are done
23022302
if (!attr[name]) {
23032303
return;

0 commit comments

Comments
 (0)