javascript - Is it possible to get es6 class constructor arguments list? -


i write services , controllers in app (angularjs - 1.6.3) using es6 classes.

i want simplify piece of code don't know whether it's possible , how es6 class constructor arguments list.

example of piece need simplify prevent duplication:

class myservice {      constructor (         $q,         $translate,     ) {          this.$q = $q;         this.$translate = $translate;     } }  angular     .module('app')     .service('myservice', myservice); 

is there way add dependencies given context automatically?

know in angular2 there decorators helps not duplicate dependencies add them in current scope (or other way)


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -