ariatemplates/hashspace — pull request #71 by b-laporte (2014-02-22 22:55:11+00:00)
Title: dynamic template path support

This pull request introduces the support of dynamic path for sub-templates and components
(and therefore it also fixes issue #11)

This feature can be useful to dynamically change a view through a sub-template:
```
var $set = require("hsp/$set");

# template test(ctxt)

Change template

<#ctxt.view ctxt="{ctxt}"/>
# /template

# template tplA(ctxt)

A: {ctxt.msg}

# /template

# template tplB(ctxt)

B: {ctxt.msg2}

# /template

var ctxt={
view: tplA,
msg: "Hello World",
msg2: "Always look on the bright side of life!"
}

function swapTemplate() {
var newtpl=(ctxt.view===tplA)? tplB : tplA;
$set(ctxt,"view",newtpl);
}

// display the template in the #output div
test(ctxt).render("output");
```