benjamincharity
1/17/2018 - 12:09 PM

Throw errors only when in dev mode.

import { isDevMode } from '@angular/core';


export class Foo {
  @Input()
  set foo(v: any) {
    if (isDevMode() && myThingIsInvalid) {
      throw myErrorForDevs();
    }
  }
}