'use strict';
angular.module('arethusa.morph').directive('formSelector', function () {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      var id = scope.id;

      function action(event) {
        event.stopPropagation();
        scope.$apply(function() {
          if (scope.form.selected) {
            scope.plugin.unsetState(id);
          } else {
            scope.plugin.setState(id, scope.form);
          }
        });
      }

      scope.$watch('form.selected', function(newVal, oldVal) {
        scope.text = newVal ? 'D' : 'S';
      });

      element.bind('click', action);
    },
    template: '\
      <span\
        class="button micro radius"\
        ng-class="{ success: form.selected }">\
         {{ text }}\
      </span>\
    '
  };
});

@@ -540,32 +540,102 @@
 ope.
-text = newVal ? 'D' : 'S
+iconClass = newVal ? 'minus' : 'plus';%0A        scope.title     = newVal ? 'deselect' : 'select
 ';%0A 
@@ -755,16 +755,45 @@
 adius%22%5C%0A
+        title=%22%7B%7B title %7D%7D%22%5C%0A
         
@@ -845,18 +845,43 @@
     
-%7B%7B text %7D%7D
+ %3Ci class=%22fi-%7B%7B iconClass %7D%7D%22%3E%3C/i%3E
 %5C%0A  

Use icons and titles in formSelector