How to set default parameter for @Input in Angular2?
try
@Input() name: string = 'noname';
You can intercept @Input()
with a setter and have it backed by a private field. In setter, you do a nullcheck so field gets set only to a non-null value. As last, you bind your template to a private fied in which you have set initial value.