Looks like since everything is now lazy loaded, directives also need to have a DirectiveModule generated that injects the directive, and that needs to then be imported everywhere the directive is used, So the actual bug may be that ionic g directive needs to generate a module for the directive too.
It seems that a custom directive will work if declared on a page which uses it directly or imported from a module on a page directly but NOT when it is declared in app.module.ts or imported as a module into app.module.ts … …
Current workaround is to put the directives into a common module and import that module into the pages where the directive is required. Not ideal but at least something.
Am I the only one questioning whether all of this is generally worth it? Another option would seem to be blowing lazy loading off entirely, and that’s currently where I’m at.
No, you aren’t the only one. I’m still trying to figure out what my next move is since I’m not going to get the benefits of being able to use the directive anywhere in my ionic 4 project without having to import the module on every page. Disappointed - let me know if you have any other ideas!
In case it wasn’t clear from my last post, my suggestion is to completely ignore lazy loading: put everything in a single AppModule, get rid of all the submodules, and the providedIn decorator on services while you’re at it.