ericgio / react-bootstrap-typeahead

React typeahead with Bootstrap styling
http://ericgio.github.io/react-bootstrap-typeahead/
MIT License
1.01k stars 407 forks source link

app.component.html #858

Closed fida2013 closed 1 month ago

fida2013 commented 2 months ago

<ul *ngFor="let userlist of userlists">

  • {{userlist.name}}
  • <li>{{userlist.phone}}</li>
    
    <ul *ngFor="let account of userlists.socialAccount"> 
        <li>{{account}}</li> 
    </ul>

    app.component.ts -----------file userlists = [ { name: 'bilal', phone: '99999', socialAccount:['fcebook', 'insta', 'gmail'] }, { name: 'sahim', phone: '77777' , socialAccount:['youtube', 'Tiktok', 'hbl banking']}, { name: 'tayyab', phone: '2238' , socialAccount:['yahoo', 'indeed', 'likee'] }, { name: 'sohaib', phone: '66666' , socialAccount:['linkedin', 'rozee', 'whatsapp'] } ];

    fida2013 commented 2 months ago

    this type of error Property 'socialAccount' does not exist on type '{ name: string; phone: string; socialAccount: string[]; }[]'.

    ericgio commented 1 month ago

    Hey @fida2013, I'm unclear on the problem you're encountering here. It doesn't seem to be related to the typeahead code itself; is it a TS issue? It's hard for me to diagnose your issue based on the information you provided, but it looks like the type is an array of objects and TS is looking for the object property, which would indeed be absent.