     engine.registerPartial(tplName, compiled)
     compiled
 
-  # Handles the various priorities and locations of templates 
+  # Handles the various priorities and locations of templates
   _getTemplateDefinition = (name, ref, widgetName, dom)->
     path = "#{ref}/#{name}"
     tplName = [widgetName, name.replace(/^_/, '')].join("/")

define ['lib/hullbase', 'handlebars'], (Hull, Handlebars) ->

  #Compiles the template depending on its definition
  setupTemplate = (tplSrc, tplName) ->
    engine = module.templateEngine 
    tplName = tplName.replace(/\//g,'.',)
    if (_.isFunction(tplSrc))
      compiled = engine.template tplSrc

          tplDef = _getTemplateDefinition name, ref, widgetName, app.core.dom.find
          if tplDef
            ret[name] = tplDef
          else
            undefinedTemplates.push([name, "text!#{ref}/#{name}.#{format}"])
        if undefinedTemplates.length > 0
          module.require(_.map(undefinedTemplates, (p) -> p[1]), ->
