Angular 6 numberonly directive not working
When you are using custom directive/pipe in a shared module, you need to exports it also.
Basically in your tutorial, he created the directive and declared it in the app module. But in your example, you put your directive in a shared module, so you need to put your directive in the declarations bracket but also in the exports.
shared.module.ts :
@NgModule({
/* ... */
declarations: [YourDirective],
exports: [YourDirective]
/* ... */
})