I've been struggling to understand how to effectively write AngularJS directives, even after reading various blogs. The issue I am facing is with an array of names in the format "lastname, firstname". My goal is to create a directive that will display them as "firstname lastname."
Here is the structure of my HTML:
<div ng-repeat="names in nameArray"
<custom-name-format> {{names}} </custom-name-format>
</div>
Could you please guide me on how to pass the 'names' parameter to the directive?
Controller:
angular.module('nameApp').directive('customNameFormat', function() {
// How can I access and manipulate {{names}} within this directive?
});