I have the following markup:
<div parent="john">
<div child>Child 1 </div>
<div child>Child 2</div>
</div>
And the following child directive:
angular.module("app").directive("child", child);
function child($parse) {
var child = {
link: link,
replace: false,
restrict: "A"
};
return child;
function link(scope, element, attributes) {
}
}
How can I create a Parent directive (where a value is set, for example, John) and on Child directive access the parent value?