   # Unsubscribes from the model and the element.
   unbind: =>
     @binder.unbind?.call @, @el
-    @view.adapters[@key.interface].unsubscribe @model, @key.path, @sync
+    @view.adapters[@key.interface].unsubscribe(@model, @key.path, @sync) if @key
 
     if @dependencies.length
       for dep in @dependencies


  # Syncs up the view binding with the model.
  sync: =>
    @set @view.adapters[@key.interface].read @model, @key.path

  # Publishes the value currently set on the input element back to the model.
  publish: =>

class Rivets.TextBinding extends Rivets.Binding
  # Initializes a text binding for the specified view and text node.
  constructor: (@view, @el, @type, @keypath, @options = {}) ->
    @formatters = @options.formatters || []
    @setModel()

