Im trying to create a filter for my stories. I subscribe to the API call, and i get the data as an array of objects. I get this error, when im typing in the filterings. I've only included the relevant parts, but i can provide more if needed. Im not that great to Pipes in Angular 4, so any tips would be helpful! Thank you.

- import { Component, OnInit } from '@angular/core';
- import {YeucauService} from 'src/app/Shared/services/yeucau.service';
- import { sanpham } from 'src/app/Shared/models/sanpham';
- @Component({
- selector: 'app-yeucau',
- templateUrl: './yeucau.component.html',
- styleUrls: ['./yeucau.component.css']
- })
- export class YeucauComponent implements OnInit {
- showDropDown = false;
- name:string;
- public sanpham=[];
- constructor(public yeucauService:YeucauService) { }
- ngOnInit() {
- this.yeucauService.GetAllsanpham().subscribe(data=>this.sanpham=data);
- }
- selectValue(value:sanpham) {
- this.name=value.tensanpham;
- }
- closeDropDown() {
- this.showDropDown = !this.showDropDown;
- }
- openDropDown() {
- this.showDropDown = !this.showDropDown;
- }
- }
Muthu KumarPosted Jan 2, 2019, 5:00 AM