InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe', cannot modify HTML2019 Community Moderator ElectionHow can I merge properties of two JavaScript objects dynamically?How to check if an object is an array?Iterate through object propertiesBinding select element to object in AngularAngular async pipe and object propertyAngular2 n - getting invalid argument [object Object] … for pipe 'AsyncPipe'InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' Help needed with processing json data | Angular5InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' && AppComponent.html:1 ERROR TypeError: this.Courses$.push is not a functionInvalidPipeArgument:'[object Object]' for pipe'Asyncpipe'Use ngFor with async pipe to display array of observables

Knife as defense against stray dogs

Calculate the frequency of characters in a string

Is there a term for accumulated dirt on the outside of your hands and feet?

Could Sinn Fein swing any Brexit vote in Parliament?

What does "Four-F." mean?

Should I be concerned about student access to a test bank?

Synchronized implementation of a bank account in Java

Optimising a list searching algorithm

What is the English word for a graduation award?

Print a physical multiplication table

I seem to dance, I am not a dancer. Who am I?

How is the partial sum of a geometric sequence calculated?

Can a medieval gyroplane be built?

Generic TVP tradeoffs?

Writing in a Christian voice

Print last inputted byte

Recruiter wants very extensive technical details about all of my previous work

How does 取材で訪れた integrate into this sentence?

How are passwords stolen from companies if they only store hashes?

Suggestions on how to spend Shaabath (constructively) alone

Is there a creature that is resistant or immune to non-magical damage other than bludgeoning, slashing, and piercing?

Fewest number of steps to reach 200 using special calculator

PTIJ What is the inyan of the Konami code in Uncle Moishy's song?

Help rendering a complicated sum/product formula



InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe', cannot modify HTML



2019 Community Moderator ElectionHow can I merge properties of two JavaScript objects dynamically?How to check if an object is an array?Iterate through object propertiesBinding select element to object in AngularAngular async pipe and object propertyAngular2 n - getting invalid argument [object Object] … for pipe 'AsyncPipe'InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' Help needed with processing json data | Angular5InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' && AppComponent.html:1 ERROR TypeError: this.Courses$.push is not a functionInvalidPipeArgument:'[object Object]' for pipe'Asyncpipe'Use ngFor with async pipe to display array of observables










1















I am working to populate a dropdown on an application using Angular and ngrx. The app uses a dropdown component which is used across the entire application for dropdowns, so I cannot modify it.



The HTML from that component which is most important for my question is as follows:



<option *ngFor="let option of options" [value]="stringifyOption(option.value)" [selected]="option.value === (selectedValue | async)">
option.text
</option>


I am getting my dropdown options, which is an array of objects (dateOptions), from the store. Each object has a property value (week) which I am getting and setting as the options for the dropdown.



this.weekDropdownOptions = dateOptions.map(weekObj => weekObj.week);


Logging weekDropdownOptions in the console returns an array of the options like I was expecting, like this:



["04/01 - 04/07", "04/08 - 04/14"]


My HTML has the selector for the dropdown and sets [options]="weekDropdownOptions"



I can't seem to get past this error:




InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'.




It is pointing towards the dropdown component, however I can't modify the HTML. What can I do in my code to make this work?










share|improve this question
























  • can you post selectedValue type and when it gets updated?

    – displayName
    Mar 6 at 22:15















1















I am working to populate a dropdown on an application using Angular and ngrx. The app uses a dropdown component which is used across the entire application for dropdowns, so I cannot modify it.



The HTML from that component which is most important for my question is as follows:



<option *ngFor="let option of options" [value]="stringifyOption(option.value)" [selected]="option.value === (selectedValue | async)">
option.text
</option>


I am getting my dropdown options, which is an array of objects (dateOptions), from the store. Each object has a property value (week) which I am getting and setting as the options for the dropdown.



this.weekDropdownOptions = dateOptions.map(weekObj => weekObj.week);


Logging weekDropdownOptions in the console returns an array of the options like I was expecting, like this:



["04/01 - 04/07", "04/08 - 04/14"]


My HTML has the selector for the dropdown and sets [options]="weekDropdownOptions"



I can't seem to get past this error:




InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'.




It is pointing towards the dropdown component, however I can't modify the HTML. What can I do in my code to make this work?










share|improve this question
























  • can you post selectedValue type and when it gets updated?

    – displayName
    Mar 6 at 22:15













1












1








1








I am working to populate a dropdown on an application using Angular and ngrx. The app uses a dropdown component which is used across the entire application for dropdowns, so I cannot modify it.



The HTML from that component which is most important for my question is as follows:



<option *ngFor="let option of options" [value]="stringifyOption(option.value)" [selected]="option.value === (selectedValue | async)">
option.text
</option>


I am getting my dropdown options, which is an array of objects (dateOptions), from the store. Each object has a property value (week) which I am getting and setting as the options for the dropdown.



this.weekDropdownOptions = dateOptions.map(weekObj => weekObj.week);


Logging weekDropdownOptions in the console returns an array of the options like I was expecting, like this:



["04/01 - 04/07", "04/08 - 04/14"]


My HTML has the selector for the dropdown and sets [options]="weekDropdownOptions"



I can't seem to get past this error:




InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'.




It is pointing towards the dropdown component, however I can't modify the HTML. What can I do in my code to make this work?










share|improve this question
















I am working to populate a dropdown on an application using Angular and ngrx. The app uses a dropdown component which is used across the entire application for dropdowns, so I cannot modify it.



The HTML from that component which is most important for my question is as follows:



<option *ngFor="let option of options" [value]="stringifyOption(option.value)" [selected]="option.value === (selectedValue | async)">
option.text
</option>


I am getting my dropdown options, which is an array of objects (dateOptions), from the store. Each object has a property value (week) which I am getting and setting as the options for the dropdown.



this.weekDropdownOptions = dateOptions.map(weekObj => weekObj.week);


Logging weekDropdownOptions in the console returns an array of the options like I was expecting, like this:



["04/01 - 04/07", "04/08 - 04/14"]


My HTML has the selector for the dropdown and sets [options]="weekDropdownOptions"



I can't seem to get past this error:




InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'.




It is pointing towards the dropdown component, however I can't modify the HTML. What can I do in my code to make this work?







javascript angular dropdown ngrx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 22:18









Chris G

6,40321022




6,40321022










asked Mar 6 at 22:11









tb517tb517

558




558












  • can you post selectedValue type and when it gets updated?

    – displayName
    Mar 6 at 22:15

















  • can you post selectedValue type and when it gets updated?

    – displayName
    Mar 6 at 22:15
















can you post selectedValue type and when it gets updated?

– displayName
Mar 6 at 22:15





can you post selectedValue type and when it gets updated?

– displayName
Mar 6 at 22:15












2 Answers
2






active

oldest

votes


















1














The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.



According to the error, selectedValue is an object so you can not use the async pipe.






share|improve this answer























  • This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

    – tb517
    Mar 8 at 16:25


















0














the async pipe expects an Observable and not an Object. it would be interesting to see how exactly selectedValue is populated and why it's used with the async pipe.



here is an example on the difference in stackblitz https://stackblitz.com/edit/angular-vv7pzs






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032989%2finvalidpipeargument-object-object-for-pipe-asyncpipe-cannot-modify-html%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.



    According to the error, selectedValue is an object so you can not use the async pipe.






    share|improve this answer























    • This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

      – tb517
      Mar 8 at 16:25















    1














    The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.



    According to the error, selectedValue is an object so you can not use the async pipe.






    share|improve this answer























    • This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

      – tb517
      Mar 8 at 16:25













    1












    1








    1







    The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.



    According to the error, selectedValue is an object so you can not use the async pipe.






    share|improve this answer













    The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.



    According to the error, selectedValue is an object so you can not use the async pipe.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 6 at 22:52









    Javier RojanoJavier Rojano

    43937




    43937












    • This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

      – tb517
      Mar 8 at 16:25

















    • This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

      – tb517
      Mar 8 at 16:25
















    This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

    – tb517
    Mar 8 at 16:25





    This is the correct answer, as I removed '| async' from the dropdown and the InvalidPipeArgument errors disappeared. Unfortunately I cannot remove that piece of code as many other components in the app use it. Right now I'm grabbing the data for the dropdown from the store, and just setting it to a variable so I can use it. Can I set this variable as an Observable? For example: public weekDropdownOptions: Observable<any> ? How would I then use this variable when I set it equal to the dateOptions?

    – tb517
    Mar 8 at 16:25













    0














    the async pipe expects an Observable and not an Object. it would be interesting to see how exactly selectedValue is populated and why it's used with the async pipe.



    here is an example on the difference in stackblitz https://stackblitz.com/edit/angular-vv7pzs






    share|improve this answer



























      0














      the async pipe expects an Observable and not an Object. it would be interesting to see how exactly selectedValue is populated and why it's used with the async pipe.



      here is an example on the difference in stackblitz https://stackblitz.com/edit/angular-vv7pzs






      share|improve this answer

























        0












        0








        0







        the async pipe expects an Observable and not an Object. it would be interesting to see how exactly selectedValue is populated and why it's used with the async pipe.



        here is an example on the difference in stackblitz https://stackblitz.com/edit/angular-vv7pzs






        share|improve this answer













        the async pipe expects an Observable and not an Object. it would be interesting to see how exactly selectedValue is populated and why it's used with the async pipe.



        here is an example on the difference in stackblitz https://stackblitz.com/edit/angular-vv7pzs







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 6 at 22:50









        jahllerjahller

        1,0801423




        1,0801423



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032989%2finvalidpipeargument-object-object-for-pipe-asyncpipe-cannot-modify-html%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко