         switch ast.command
           when "view" then new Node.view(ast, model, controller)
           when "collection" then new Dynamic.collection(ast, model, controller)
-          when "if" then new If(ast, model, controller)
+          when "if" then new Dynamic.if(ast, model, controller)
           when "in" then new Dynamic.in(ast, model, controller)
           else new Node.helper(ast, model, controller)
       else throw SyntaxError "unknown type '#{ast.type}'"

      subModel = get(model, ast.arguments[0])
      if subModel
        collection.update([subModel])
      else
        collection.update([])
    update()


  get: -> format(@model, @ast.value, @ast.bound)

Nodes =
  compile: (ast, model, controller) ->
    switch ast.type
