public
Last active

  • Download Gist
base.and.substitute.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
YUI().use('base', 'substitute', function(Y) {
 
function Example(config) {
Example.superclass.constructor.apply(this, arguments);
}
Example.NAME = 'Example';
Example.ATTRS = {
foo: {
value: 'bar'
}
};
Y.extend(Example, Y.Base);
 
var test = new Example();
 
console.log(test.get('foo')); // 'bar'
console.log(Y.substitute('{foo}', { foo: 'bar' })); // 'bar'
console.log(Y.substitute('{foo}', test)); // '{foo}'
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.