I have a directive that I want to reference in multiple divs. Each div must have access to the same values. Here is a simplified version:
.directive('sampleDir', function() {
var control = function($scope, $element, $attr) {
$scope.value1 = '';
$scope.value2 = '';
}
return {
controller: control,
link: link // defined in code somewhere and needs access to separate value1 and value2
};
});
So basically each div that uses this directive should have its separate values for value1 and value2, or should have a separate controller maybe? How would I do this?