           @submitLabel = def['submit']
           @resetLabel = def['reset']
           @pages = (new Page(p) for p in def['pages'])
+          if def['dependencies']? then switch d for d in def['dependencies']
+            when 'validator' then validators.add(d)
+            when 'field' then dump 'field'
 
+        submit: -> this.validate()
+        
 
       class Page extends Displayable
         constructor: (def) ->

## 

angular.module('CoolFormServices').
  factory('coreService', (validators)->

    return(definition) ->

      _fields = {}                  

      class Element

          @subElemName = subElemName
          @valid = true

        reset: -> e.reset() for e in this[@subElemName]

        validate: ->
          for e in this[@subElemName]
            if e.display is true and e.validate() is false
              @valid = false; return @valid              
          @valid = true; return @valid

      class Displayable extends Element
        _doDisplay: (def, showOrHide) ->
