简体   繁体   English

无法绑定到“数据链接”,因为它不是“td”的已知属性

[英]Can't bind to 'data-link' since it isn't a known property of 'td'

Actually I was doing angular migration from angularjs to angular 10. While doing the upgrade we are facing an issue with this data-link binding.实际上,我正在执行从 angularjs 到 angular 10 的 angular 迁移。在进行升级时,我们遇到了这个data-link绑定的问题。 keep getting the error不断收到错误

Can't bind to 'data-link' since it isn't a known property of 'td'无法绑定到“数据链接”,因为它不是“td”的已知属性

Actually they were building a grid(table structure) in the UI, It's row click will navigate to some other page, the whole row will act as a hyperlink and they were passing the clicked cell information to the next page.实际上,他们在 UI 中构建了一个网格(表格结构),单击行将导航到其他页面,整行将充当超链接,并且他们将单击的单元格信息传递到下一页。

Following is the angularjs code which we needs to convert to angular 10.以下是 angularjs 代码,我们需要将其转换为 angular 10。

<tr ng-repeat="data in vm.responseData" ng-click="vm.goToSummary(data,this)">
    <td data-link="{{data.Description}}">
        <span ng-bind="data.Description" 
              data-link="{{data.Description}}">
        </span>
    </td>
    <td data-link="{{data.Description + 'propA'}}">
        <div data-link="{{data.Description + 'propA'}}" >{{data.propA}}</div>
        <span data-link="{{data.Description + 'propA_' + 'Priority'}}">{{data.propACount}}</span>
    </td>
    <td data-link="{{data.Description + 'propB'}}">
        <div data-link="{{data.Description + 'propB'}}" >{{data.propB}}</div>
        <span data-link="{{data.Description + 'propB_' + 'Priority'}}">{{data.propBCount}}</span>
    </td>
 </tr>

Can someone help me to identify how to use data-link binding in angular, or how to resolve this error.有人可以帮我确定如何在 angular 中使用数据链路绑定,或者如何解决此错误。 will also be helpful if someone can tell what's the role of data-link link in the above code.如果有人能说出上述代码中data-link链接的作用,那也会很有帮助。

In my case I was migrating a code from jQuery so the original:就我而言,我正在从 jQuery 迁移代码,所以原来的:

data-sentence="mydata"

changes to:更改为:

data-sentence="{{oracion.oracion}}"

As it works, for specific data attribute you should bracket the attribute and add attr.当它起作用时,对于特定的data属性,您应该将属性括起来并添加attr.

But the following does't work:但以下不起作用:

[attr.data-sentence]="{{oracion.oracion}}"

So you need to convert it to:因此,您需要将其转换为:

[attr.data-sentence]="oracion.oracion"

But in consideration I think is better rethink the functional system of this in consideration the attribute could not be useful since you can keep the data in the angular controller (component)但考虑到我认为最好重新考虑这个功能系统,因为您可以将数据保留在 angular controller (组件)中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 2 RC 5 - 无法绑定到&#39;...&#39;,因为它不是&#39;...&#39;的已知属性 - Angular 2 RC 5 - Can't bind to '…' since it isn't a known property of '…' 无法绑定到 &#39;dtOptions&#39;,因为它不是 &#39;table&#39; 的已知属性。 - Can't bind to 'dtOptions' since it isn't a known property of 'table'. Angular 2 - 无法绑定到&#39;ngModel&#39;,因为它不是&#39;input&#39;的已知属性 - Angular 2 - Can't bind to 'ngModel' since it isn't a known property of 'input' 无法绑定到“ ngModule”,因为它不是“ input”的已知属性。 在angular 2 asp.net核心中 - Can't bind to 'ngModule' since it isn't a known property of 'input'. in angular 2 asp.net core Angular2 RC5教程:无法绑定到'ngModel',因为它不是'input'的已知属性 - Angular2 RC5 tutorial : Can't bind to 'ngModel' since it isn't a known property of 'input' 2.0.0版本无法绑定到&#39;ngIf&#39;,因为它不是&#39;div&#39;的已知属性 - 2.0.0 version Can't bind to 'ngIf' since it isn't a known property of 'div' 无法绑定到“ngForOf”,因为它不是 Ionic / Angular 9 中“ion-item”的已知属性 - Can't bind to 'ngForOf' since it isn't a known property of 'ion-item' in Ionic / Angular 9 离子图标和“无法绑定到&#39;名称&#39;,因为它不是已知的本机属性”错误 - ionic icon and “Can't bind to 'name' since it isn't a known native property” error |官方指南坏了吗?| 无法绑定到“ ngFor”,因为它不是已知的本机属性 - |Official guide broken?| Can't bind to 'ngFor' since it isn't a known native property 错误:模板解析错误:无法绑定到“选项”,因为它不是“图表”的已知属性 - Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'chart'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM