get set method in angular code example
Example: get set propoties in angular
var Element = (function() {
function Element() {
this._class = null;
}
Object.defineProperty(Element.prototype, 'className', {
get: function() {
return this._class;
},
set: function(name) {
this._class = 'todd-' + name;
},
enumerable: true,
configurable: true,
});
return Element;
})();