简体   繁体   中英

can't output json object to html in angular and get pipe error

when i write

{{form}}

it's output [object Object] but when i write

{{form | json}}
ERROR TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TView'
    |     property 'blueprint' -> object with constructor 'LViewBlueprint'
    --- index 1 closes the circle
    at JSON.stringify (<anonymous>)
    at JsonPipe.transform (common.mjs:4605)
    at Module.ɵɵpipeBind1 (core.mjs:22291)
    at UserSettingsFormsComponent_Template (user-settings-forms.component.html:97)
    at executeTemplate (core.mjs:9603)
    at refreshView (core.mjs:9469)
    at refreshComponent (core.mjs:10640)
    at refreshChildComponents (core.mjs:9265)
    at refreshView (core.mjs:9519)
    at refreshComponent (core.mjs:10640)

enter image description here

i found the answer here Angular Json Pipe TypeError: Converting circular structure to JSON it must be writen

{{form.value|json}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM