RouterLink无法在角度2的网格中工作 [英] RouterLink not working in grid in angular 2
问题描述
最近,我开始在我的Angular中使用jqwidgets (这里)项目, 效果很好,但是唯一的问题是我在每个单元格中都进行了编辑.到那个编辑按钮routerLink不能正常工作.
Recently i started using jqwidgets (here) for my Angular project, it worked well but the only problem is I put edit at each cell.To that edit button routerLink is not working.
我的代码,
this.columns =
[
{
text: 'Id', columntype: 'textbox', width: 80
},
{
text: 'Name', columntype: 'textbox',datafield: 'name', width: 130
},
{
text: 'Group Name', columntype: 'textbox', datafield: 'group_id', width: 130
},
{
text: 'Actions',datafield: 'id', cellsrenderer: Action, width: 100
}
];
这是我的动作功能,
var Action = function (row,datafield,value) {
return '<button ><a routerLink="pages/users">EDIT</a</button>'
}
当我用href代替其能工作的routerLink时,任何人都可以帮助我.谢谢.
When i replace routerLink with href its working,can anyone please help me.Thanks.
推荐答案
似乎该小部件会将您的html代码直接添加到DOM中.因此,绕过了角度,它不是有效的"角度对象,也无法通过角度本身进行处理/识别.
Seems like that this widget will add your html code directly to the DOM. So angular is bypassed and it's not a "valid" angular-object and isn't handled/recognized by angular itself.
这是该小部件的问题,似乎您无法更改该行为.
It's a problem of that widget, seems like you can't change that behavior.
这篇关于RouterLink无法在角度2的网格中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!