I've defined the following trivial directive
angular.module('my-app').directive('formPanel', function () {
return {
restrict: 'EA',
scope: {
forms: "=",
title: "@",
formSelect: "&"
},
templateUrl: 'formPanel.html'
};
}
);
the contents of the formPanel.html template are:
<h1>foo</h1>
If I invoke the directive 3 times like so:
<form-panel title="title" forms="entitledApplications"
form-select="goToFormDetails(selectedForm)"/>
<form-panel title="title" forms="maybeEntitledApplications"
form-select="goToFormDetails(selectedForm)"/>
<form-panel title="title" forms="applications"
form-select="goToFormDetails(selectedForm)"/>
The following output is rendered
<h1>foo</h1>
But I was expecting the following
<h1>foo</h1>
<h1>foo</h1>
<h1>foo</h1>
It seems that the problem occurs if the list passed to the forms scope attribute is empty/null, but I don't understand why.