Friday, 13 September 2013

Compile a dynamic directive with a fragment of the parent scope

Compile a dynamic directive with a fragment of the parent scope

I want to insert a dynamic directive and pass it through a mini-scope
taken from the parents larger model, ie $scope.model[i] where i is the
index of the list item you just clicked.
This is my insert code:
element.append($compile("<newdirective />")($scope));
I could pass it the entire model and the index through the attributes but
seems far than ideal.

No comments:

Post a Comment