You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constGenerator=require('yeoman-generator');classBaseGeneratorextendsGenerator{prompting(){// customised prompt}}classMyGeneratorextendsBaseGenerator{// implements other methods but does not implement prompting}
This does not work, BaseGenerator's prompting method is not called when MyGenerator is run. The fix is to do:
It looks like the reason for this is that method names are only counted if they're on the prototype of the generator directly. I'd argue that this is pretty surprising behavior, but it seems like it was done fairly deliberately, perhaps for historical reasons?
The text was updated successfully, but these errors were encountered:
Consider this code:
This does not work, BaseGenerator's
prompting
method is not called when MyGenerator is run. The fix is to do:It looks like the reason for this is that method names are only counted if they're on the prototype of the generator directly. I'd argue that this is pretty surprising behavior, but it seems like it was done fairly deliberately, perhaps for historical reasons?
The text was updated successfully, but these errors were encountered: