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

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved