properties - strange javascript property definition using polymer -
in following code xfoo object (or prototype) has actual property bar value of 5 , will have actual method foo(). kind of object notation this? not how define properties in ecmascript 5. have expected xfoo.bar object has function get() , xfoo.foo object has method value(). missing here?
var xfoo = document.registerelement('x-foo', { prototype: object.create(htmlelement.prototype, { bar: { get: function () { return 5; } }, foo: { value: function () { alert('foo() called'); } } }) }); var xfoo = new xfoo();
yes, guess correct:
sorry, have @ least tried google javascript object.create?
Comments
Post a Comment