Problem:
I try to pass the value from ng-repeat to the child directive, but when I try to access my passed variable in directive 2, I get "undefined".
Here is an illustration of what I'm trying. Basically, directive 1 represents an array of widgets, and directive 2 represents a single widget. I am trying to pass an element from an ng-repeat loop to my child directive.

My attempt:
Here is a simplified version of directive 1 template :
<li ng-repeat="item in widgets">
<directive2 item="item"></directive2>
</li>
Here is a simplified version of directive 2 :
angular.module('directive2').directive(
['$compile', '$rootScope',
function ($compile, $rootScope) {
return {
restrict: 'E',
scope: { item: '=' },
templateUrl: 'ext-modules/tile/widgetTemplate.html',
link: function (scope, element, attrs) {
console.log(scope.item);
}
};
}]);
ng-repeat , , . , console.log : undefined.
:
ng-repeat child?
: http://jsfiddle.net/3znEu/112/