我有以下模板:
<Page.actionBar>
<ActionBar title="Modules" automationText="ActionBar">
<NavigationButton icon="res://back_btn" tap="goBack" automationText="GoBack"></NavigationButton>
<Android>
<ActionItem id="exampleMenuButton" icon="res://menu" automationText="ExampleMenu"></ActionItem>
</Android>
<iOS>
<ActionItem id="exampleMenuButton" ios.position="right" automationText="ExampleMenu">
<ActionItem.actionView>
<Image src="res://menu" width="22" height="22" margin="0, -11, 0, 11"></Image>
</ActionItem.actionView>
</ActionItem>
</iOS>
</ActionBar>
</Page.actionBar>
来自nativescript-marketplace-demo。首先,由于类似错误,我不得不将标签更改为不自动关闭,Only void and foreign elements can be self closed "NavigationButton"
现在得到下面看到的错误,为什么?
CONSOLE ERROR file:///app/vendor.js:1688:24: ERROR Error: Uncaught (in promise): Error: ActionItem is not a valid View instance.
_addView@file:///app/vendor.js:77124:28 [angular]
addChild@file:///app/vendor.js:79138:22 [angular]
insertChild@file:///app/vendor.js:58553:32 [angular]
appendChild@file:///app/vendor.js:57775:38 [angular]
appendChild@file:///app/vendor.js:13726:34 [angular]
createElement@file:///app/vendor.js:9925:33 [angular]
createViewNodes@file:///app/vendor.js:12532:57 [angular]
callViewAction@file:///app/vendor.js:12944:28 [angular]
execComponentViewsAction@file:///app/vendor.js:12883:27 [angular]
createViewNodes@file:///app/vendor.js:12601:29 [angular]
createRootView@file:///app/vendor.js:12479:20 [angular]
callWithDebugContext@file:///app/vendor.js:13610:47 [angular]
create@file:///app/vendor.js:10415:60 [angular]
createComponent@file:///app/vendor.js:10615:68 [angular]
activateOnGoForward@file:///app/vendor.js:48567:70 [angular]
activateWith@file:///app/vendor.js:48553:37 [angular]
placeComponentIntoOutlet@file:///app/vendor.js:23184:28 [angular]
activateRoutes@file:///app/vendor.js:23165:50 [angular]
file:///app/vendor.js:23101:72 [angular]
forEach@[native code] [angular]
activateChildRoutes@file:///app/vendor.js:23101:36 [angular]
activate@file:///app/vendor.js:23075:33 [angular]
file:///app/vendor.js:22692:30 [angular]
file:///app/vendor.js:230:25 [angular]
...