【发布时间】:2017-03-04 11:51:03
【问题描述】:
我有来自服务的数组
private items = new Array<Item>(
{ id: 1, name: "Batman", link: "batmanscreen" },
{ id: 3, name: "doraemon", link: "dorascreen" },
...........
,
XML 组件如:
<ActionBar title="Details" class="action-bar"></ActionBar>
<FlexboxLayout flexDirection="column" class="page">
<FlexboxLayout class="m-15">
<Label class="h2" [text]="item.id + '. '"></Label>
<Label class="h2" [text]="item.name"></Label>
</FlexboxLayout>
<Label class="h4" [text]="item.link"></Label>
<Label [nsRouterLink]="['/item.link']" text="go TO Screen" ></Label>
</FlexboxLayout>
以及点击链接时安卓模拟器上的结果:
EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'item.link'
我希望变成nsRouterLink = "['/batmanscreen']",但是在nativescript导航中找不到任何指南,请指导。
在 angular 2 web 中我可以处理它,但我不知道如何在 nativescript 中做到这一点..
谢谢。
【问题讨论】:
标签: nativescript