Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
refactor($compile): simplify nodeLinkFn
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Oct 30, 2012
1 parent 4dbd845 commit 4e45a2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,12 @@ function $CompileProvider($provide) {
}
$element = attrs.$$element;

if (newScopeDirective && isObject(newScopeDirective.scope)) {
if (newIsolatedScopeDirective) {
var LOCAL_REGEXP = /^\s*([@=&])\s*(\w*)\s*$/;

var parentScope = scope.$parent || scope;

forEach(newScopeDirective.scope, function(definiton, scopeName) {
forEach(newIsolatedScopeDirective.scope, function(definiton, scopeName) {
var match = definiton.match(LOCAL_REGEXP) || [],
attrName = match[2]|| scopeName,
mode = match[1], // @, =, or &
Expand All @@ -734,7 +734,7 @@ function $CompileProvider($provide) {
// reset the change, or we will throw this exception on every $digest
lastValue = scope[scopeName] = parentGet(parentScope);
throw Error(NON_ASSIGNABLE_MODEL_EXPRESSION + attrs[attrName] +
' (directive: ' + newScopeDirective.name + ')');
' (directive: ' + newIsolatedScopeDirective.name + ')');
};
lastValue = scope[scopeName] = parentGet(parentScope);
scope.$watch(function parentValueWatch() {
Expand Down Expand Up @@ -765,7 +765,7 @@ function $CompileProvider($provide) {

default: {
throw Error('Invalid isolate scope definition for directive ' +
newScopeDirective.name + ': ' + definiton);
newIsolatedScopeDirective.name + ': ' + definiton);
}
}
});
Expand Down

0 comments on commit 4e45a2f

Please sign in to comment.