angular-ru-sdk icon indicating copy to clipboard operation
angular-ru-sdk copied to clipboard

🐞[BUG]: https://github.com/Angular-RU/angular-ru-sdk/pull/490

Open splincode opened this issue 4 years ago • 0 comments

class Cd {}

@InjectContext()
class IceCream {
    @Authowired() cd?: Cd;
}

function Authowired() {
  return function(target: Object, key: string | symbol) {
    let val = target[key];

    Promise.resolve().then(() => {
        console.log('emoji', target);
    });

    const getter = () =>  {
        return val;
    };
    const setter = (next) => {
        val = `🍦 ${next} 🍦`;
    };

    Object.defineProperty(target, key, {
      get: getter,
      set: setter,
      enumerable: true,
      configurable: true,
    });

  };
}

function AuthowireContext(constructor: Function) {
  console.log('constructor.prototype', constructor.prototype)
}

image

https://github.com/Angular-RU/angular-ru-sdk/pull/490

splincode avatar Mar 22 '21 16:03 splincode