I have an angularjs directive element with an external template (url) and controller.
app.directive('ngMyDirective', function() {
return {
restrict : 'E',
templateUrl : 'my-template.html',
controller : 'MyController'
}
});
This directive is currently used in a couple of views. The html it generates contains a textarea which requires a dynamic number of rows depending on parent view of the directive. Is there a way to pass the directive a variable to set the number of rows dynamically and which can be accessed in both the template and controller?