英文:
Property "data" is incompatible with index signature
问题
I am trying to use markdown which is giving data binding error. The datatype of [data] in my markdownComponent.d.ts file is 'string | undefined | null' but still gives error "Can't bind to 'data' since it isn't a known property of 'markdown'."
error in ecmp of markdown.component.d.ts
error: Can't bind to 'data' since it isn't a known property of 'markdown'.
error in markdownComponent.d.ts file
markdownContent is of type string and initialized
I dont understand the problem ... data and markdownContent both are of type: string then why markdownContent can not be assigned to [data]? i've imported all required modules i.e. FormsModule , ReactiveModule, ngx-markdown ...also while running command 'npm i --force ngx-markdown' i got an error that "marked" does not exist so i installed "marked" and imported it in markdownComponent.d.ts the "marked" error was resolved but still im getting error in ecmp .
I want to assign [data]="markdownContent"
英文:
I am trying to use markdown which is giving data binding error. The datatype of [data] in my markdownComponent.d.ts file is 'string |undefined|null' but still gives error " Can't bind to 'data' since it isn't a known property of 'markdown'."
error in ecmp of markdown.component.d.ts
error: Can't bind to 'data' since it isn't a known property of 'markdown'.
error in markdownComponent.d.ts file
markdownContent is of type string and initialized
I dont understand the problem ... data and markdownContent both are of type: string then why markdownContent can not be assigned to [data]? i've imported all required modules i.e. FormsModule , ReactiveModule, ngx-markdown ...also while running command 'npm i --force ngx-markdown' i got an error that "marked" does not exist so i installed "marked" and imported it in markdownComponent.d.ts the "marked" error was resolved but still im getting error in ecmp .
I want to assign [data]="markdownContent"
答案1
得分: 2
我在尝试在 Angular 15 中使用 ngx-markdown@16.0.0
时遇到了相同的问题。
降级到 ngx-markdown@15.1.2
修复了它。
英文:
I had the same issue while trying to use ngx-markdown@16.0.0
with angular 15
Downgrading to ngx-markdown@15.1.2
fixed it
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论