Angular 8.2 custom decorator bug (related github issue)
When running in prod mode, with a ES2015 target, any custom decorator that is used on an input in a library used by the app will simply be ignored.
This repository contains:
- a library (srcfolder) that provides amy-testcomponent that used aCustomDecoratordecorator on itsvalueinput, and displays thevalue
- a test app (test-appfolder) that usesmy-testby passing it avalue
CustomDecorator simply overrides the input by making sure it always has the value success. It also console.log Calling CustomDecorator when called.
This code should then always display success
<my-test [value]="16"></my-test>In dev mode, with a ES2015 target, success is displayed, and Calling CustomDecorator is displayed in the console.
In prod mode, with a ES5 target, success is displayed, and Calling CustomDecorator is displayed in the console.
But, in prod mode, with a ES2015 target, 16 is currently displayed, and Calling CustomDecorator is not displayed in the console.
Using ng serve or ng build doesn't seem to matter.
The bug is not present in Angular 8.0.x or 8.1.x.
npm run build-lib # or npm run watchnpm start -- --prodThen open http://localhost:3000
npm startThen open http://localhost:3000
npm run start-es5 -- --prodThen open http://localhost:3000