Access ts object in html


#1

Hi guys I am getting this error just want to know how can I display variable values in html from I have done already that using for loop but its litttle different now

my ts code

 this.tempData.push({
            "data": tempdata", "created_at": "tempCreated"
          });

my html code

 <li class="list-images animated bounceInLeft cart-row" [(ngModel)]="tempData" name="tempData">
        <ion-card>
          <p> {{tempData.data}} </p>
                </ion-card>
      </li>

error

Uncaught (in promise): Error: No value accessor for form control with name: 'tempData' Error: No value accessor for form control with name: 'tempData' at d (http://localhost:8100/build/polyfills.js:3:3991) at _throwError (http://localhost:8100/build/main.js:22004:11) at setUpControl (http://localhost:8100/build/main.js:21917:9) at NgModel._setUpStandalone 

#2

Hi if ur not using any form tag for above html please remove the name: ‘tempData’ in li tag.

If u still issue please post total html and ts file so that we can understood clearly.


#3

hi thanks for reply I got it I was accessing in a wrong way