   require: 'ngModel'
   restrict: 'A'
   scope:
-    dateMin: '=min'
-    dateMax: '=max'
-    model: '=ngModel'
+    min: '='
+    max: '='
+    model: '=ngmodel'
     opts: '=options'
     clearable: '='
   link: ($scope, element, attrs, modelCtrl) ->

        else date.format(opts.locale.format)

      if opts.singleDatePicker
        f(viewVal.startDate)
      else
        [f(viewVal.startDate), f(viewVal.endDate)].join(opts.locale.separator)

    _parse = (value) ->
      f = (val) ->


    _init()

    _initBoundaryField = (field, validator, modelField, optName) ->
      if attrs[field]
        modelCtrl.$validators[field] = (value) ->
          validator(opts[optName], value[modelField])
        $scope.$watch field, (date) ->
          opts[optName] = if date then moment(date) else false
          _init()

    _initBoundaryField('min', _validateMin, 'startDate', 'minDate')
    _initBoundaryField('max', _validateMax, 'endDate', 'maxDate')

    if attrs.options
      $scope.$watch 'opts', (newOpts) ->
        opts = angular.merge(opts, newOpts, {autoUpdateInput: false})
        _init()
      , true

