import { isDevMode } from '@angular/core'; export class Foo { @Input() set foo(v: any) { if (isDevMode() && myThingIsInvalid) { throw myErrorForDevs(); } } }