Angular: Bind to an @Input alias

You can either turn off rule in tslint.json

"no-input-rename": false

or disable checking for only specific line like:

// tslint:disable-next-line:no-input-rename
@Input('appAvatarColor') name: string;

My question is why is this considered a bad practice by default?

  • Two names for the same property (one private, one public) is inherently confusing.

  • You should use an alias when the directive name is also an input property, and the directive name doesn’t describe the property.

From https://angular.io/docs/ts/latest/guide/style-guide.html#!#05-13

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)