 # turn an element into a jsplumb source
 app.directive "source", [ 'Plumb', '$log', (Plumb, $log) ->
   link = (scope, element, attrs) ->
+    if not attrs.id or not attrs.dropScope then return
+
     if window.mutable
       Plumb.makeSource(attrs.id, attrs.dropScope)
 

# manage connections when actionset changes
app.directive "actionset", [ "$timeout", "$log", "Plumb", "Flow", ($timeout, $log, Plumb, Flow) ->


  link = (scope, element, attrs) ->

    Plumb.updateConnection(scope.actionset)

    scope.$watch (->scope.ngModel), ->
      opConfig = Flow.getOperatorConfig(scope.ngModel.type)
      scope.verbose_name = opConfig.verbose_name

  return {
    template: '<span>[[verbose_name]]</span>'
    restrict: "C"
