Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created March 5, 2014 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardolundgren/9377437 to your computer and use it in GitHub Desktop.
Save eduardolundgren/9377437 to your computer and use it in GitHub Desktop.
Y.App rendering each view in a different element
Y.HeaderView = Y.Base.create('header', Y.View, [], {
ATTRS: {
container: { value: '#header' }
}
});
Y.BodyView = Y.Base.create('body', Y.View, [], {
ATTRS: {
container: { value: '#body' }
}
});
Y.FooterView = Y.Base.create('footer', Y.View, [], {
ATTRS: {
container: { value: '#footer' }
}
});
var app = new Y.App({
views: {
header: { type: Y.HeaderView },
body: { type: Y.BodyView },
footer: { type: Y.FooterView }
},
routes: {
value: [
{
path: '/home',
callbacks: function(req, res, next) {
app.showView('header');
app.showView('body');
app.showView('footer');
}
}
]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment