 
       channel.bind 'nextStep', (trans, data) -> console.log data
 
+      scope.$watch 'tool.ident', (ident) ->
+        return unless ident and conf[ident]
+        channel.call
+          method: 'configure'
+          params: conf[ident]
+          success: -> console.log "Configured #{ ident }"
+
       scope.$watch 'step', (step) ->
         return unless step?
-        step.$promise.then -> channel.call
-          method: 'init'
-          params: step.data
-          error: -> console.error "initialization failed"
-          success: -> console.log "Initialized"
+        step.$promise.then ->
+
+          channel.call
+            method: 'init'
+            params: step.data
+            error: -> console.error "initialization failed"
+            success: -> console.log "Initialized"
+
+          for link in $window.document.getElementsByTagName('link') then do (link) ->
+            channel.call
+              method: 'style'
+              params:
+                stylesheet: link.href
+              success: -> console.log "Applied stylesheet: #{ link.href }"
 
 
   Directives.directive 'filterTerm', ->

      tool: '=tool'
    link: (scope, element, attrs) ->

      ctrl = "#{$window.location}/#{scope.tool.controllerURI}"
      tmpl = "#{$window.location}/#{scope.tool.templateURI}"

      require [ctrl, "text!#{ tmpl }"], (controller, template) ->

        $injector.invoke controller, this, {'$scope': scope}

        element.html(template)
        $compile(element.contents())(scope)

        scope.$apply()



        {{tool.heading}}
      </div>
      <div class="panel-body">
        <iframe is-seamless="tool.seamless" src="{{tool.src}}" width="100%">
      </div>
    """
    link: (scope, element, attrs) ->
