Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YUI.add('personView',function(Y){
- Y.PersonView = Y.Base.create(
- 'personView',
- Y.View,
- [],
- {
- initializer:function(){
- this.model = this.get('model');
- },
- render:function(){
- if (this.template) {
- this.get('container').setHTML(this.template(this.model.getAttrs(['name','age','height'])));
- } else {
- Y.io('/scripts/views/templates/Person.Template.html',{
- on:{
- complete:function(id,response){
- this.template = Y.Handlebars.compile(response.responseText);
- this.render();
- }
- },
- context:this
- });
- }
- return this;
- }
- });
- }, '0.0.1', {
- requires: ['base-build','handlebars', 'io-base','node-base','view', 'personModel']
- });
Add Comment
Please, Sign In to add comment