1

     <div class="panel-body">
         {{ (currentPlatformProfile | async)?.length }} <!-- line 1 -->
         <table>
             <tr *ngFor="let platform of {{(currentPlatformProfile | async)}}">
                     <td>{{platform.infoPlatform}}</td>
                     <td>{{platform.infoGameId}}</td>
                     <td>{{platform.infoChannel}}</td>
             </tr>
         </table> 
 </div>

my html code is in the snippet, in fact line 1 work correctly, but in the ngFor it failed with

How could I make use of this array?

Unhandled Promise rejection: Template parse errors: TypeError: Cannot read property 'toUpperCase' of undefined (" {{ (currentPlatformProfile | async) }} ]*ngFor="let platform of {{(currentPlatformProfile | async)}}"> {{plat"): ng:///AppModule/ProfilecreateComponent.html@130:24 Can't bind to '*ngFor' since it isn't a known property of 'tr'.

Blockquote

2 Answers 2

1

have you this ?

<tr *ngFor="let platform of currentPlatformProfile">
         <td>{{platform?.infoPlatform}}</td>
         <td>{{platform?.infoGameId}}</td>
         <td>{{platform?.infoChannel}}</td>
 </tr>

also in you class assign currentPlatformProfile = [] while defining , and use safe operator (?) in template for avoiding errors.

not working why ? *ngFor="let platform of {{(currentPlatformProfile | async)}}"

because you cannot use interpolation syntax ({{}}) inside angular syntax

Sign up to request clarification or add additional context in comments.

4 Comments

I have solve this problem in the following, but you provide an another solution, anyway, thanks.
Your welcome, anyways which solution you choose may i know ?
@ Pardeep Jain I apply the below solution answered by myself, but your answer is definitely in deeper level.
Ohh great self answered , glad to hear about my answer :)
0
<tr *ngFor="let platform of currentPlatformProfile | async">

would solve this problem

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.