I am looking to develop a straightforward directive that can show the status of a document. Currently, I have achieved this functionality through the controller without using a directive. However, my goal is to create a reusable directive.
https://i.sstatic.net/2i6AM.png
https://i.sstatic.net/ouReW.png
The directive would indicate the following states:
1- New: 2- Unsaved 3- Draft 4- Posted
I have created a Plunker demo: http://plnkr.co/edit/sNoHGh4c4dgYycoDAhLQ?p=preview
The directive will be placed outside the form. Is there a way for me to access its state from the directive like this:
$scope.mainform.$setSubmitted();