I am learning AngularJS, and today I come across a strange case .
I don’t understand why this is strange, just how angular.js works, and it's great!
this value looks like a version of a compressed function ...
You are right, if I run Console.log(scope.done)with non-minified code, I get:
function (locals) {
return parentGet(scope, locals);
}
compile.js:
case '&':
parentGet = $parse(attrs[attrName]);
isolateScope[scopeName] = function(locals) {
return parentGet(scope, locals);
};
, scope: { done : "&"}, angular $parse , .
, : done="logChore(chore)" , chore.
angular , ng-click="do($event)", $event, ?
Angular , locals , .
: done (chore)?
, angular & , . , , :
done = "logChore(chore); x = 1"done = "logChore(otherVar, chore)"done = "isLogged || logChore(chore)"done = "logChore(chore + 1)"
, , , , , , .
, , locals, , .