I'm currently working on developing an app with Angular 4 and encountered an error message when using
@Input('inputProducts') products: Product[];
The specific error I received reads:
[tslint] In the class "ProductListComponent", the directive input property "products" should not be renamed. Please, consider using "@Input() products: string" (no-input-rename).
Although this error isn't affecting the functionality of my app, it's bothersome and I'm unable to resolve it. Here is a snippet of the code in question:
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Product } from '../product-row/product.model';
@Component({
selector: 'app-product-list',
templateUrl: './product-list.component.html',
styleUrls: ['./product-list.component.css']
})
export class ProductListComponent implements OnInit {
@Input('inputProducts') products: Product[];
@Output() selectedProduct: EventEmitter<Product>;
constructor() {
this.selectedProduct = new EventEmitter();
}
clickedProduct(p: Product): boolean {
this.selectedProduct.emit(p);
return false;
}
ngOnInit() {
}
}
The HTML section looks like:
<app-product-list [inputProducts]="products"></app-product-list>
I would appreciate any guidance on how to address and eliminate this error.