 
   toolCssLoaded = {}
 
+  injectingLinker = (window, compile, injector) -> (scope, element, attrs) ->
+    scope.$watch 'tool.controllerURI', ->
+      if scope.tool
+
+        if scope.tool.style and not toolCssLoaded[scope.tool.style]
+          link = window.document.createElement('link')
+          link.rel = 'stylesheet'
+          link.href = scope.tool.style
+          window.document.getElementsByTagName('head')[0].appendChild(link)
+          toolCssLoaded[scope.tool.style] = true
+
+        ctrl = window.location.origin + scope.tool.controllerURI
+        tmpl = window.location.origin + scope.tool.templateURI
+
+        require [ctrl, "text!#{ tmpl }"], (controller, template) ->
+
+          injector.invoke controller, this, {'$scope': scope}
+
+          element.html(template)
+          compile(element.contents())(scope)
+
+          scope.$apply()
+
   Directives.directive 'nativeTool', ($window, $compile, $injector) ->
     restrict: 'E'
     scope:
       tool: '=tool'
       actions: '=actions'
       state: '=state'
-    link: (scope, element, attrs) ->
-
-      scope.$watch 'tool.controllerURI', ->
-        if scope.tool
-
-          if scope.tool.style and not toolCssLoaded[scope.tool.style]
-            link = $window.document.createElement('link')
-            link.rel = 'stylesheet'
-            link.href = scope.tool.style
-            document.getElementsByTagName('head')[0].appendChild(link)
-            toolCssLoaded[scope.tool.style] = true
-
-          ctrl = $window.location.origin + scope.tool.controllerURI
-          tmpl = $window.location.origin + scope.tool.templateURI
-
-          require [ctrl, "text!#{ tmpl }"], (controller, template) ->
-
-            $injector.invoke controller, this, {'$scope': scope}
-
-            element.html(template)
-            $compile(element.contents())(scope)
-
-            scope.$apply()
+    link: injectingLinker $window, $compile, $injector
+
+  Directives.directive 'angular-tool', Array ($window, $compile, $injector) ->
+    restrict: 'E'
+    link: injectingLinker $window, $compile, $injector
 
   Directives.directive 'nextStep', ($window, $compile, $injector) ->
     restrict: 'E'

          else
            init()

  Directives.directive 'filterTerm', ->
    restrict: 'AE'
    replace: true,


      channel.bind 'wants', (trans, {what, data}) -> scope.wants {what, data}

      for link in win.document.getElementsByTagName('link') then do (link) ->
        channel.call
          method: 'style'
          params:
