无法使用NativeScript+Angular-2项目访问本机api(iOS或Android)

无法使用NativeScript+Angular-2项目访问本机api(iOS或Android),nativescript,angular2-nativescript,Nativescript,Angular2 Nativescript,如何复制: tns创造一些东西-ng cd什么的 下面是链接 npm安装tns平台声明-保存开发 替换了tsconfig.json和reference.d.ts的内容 tns运行iOS 我要走了 file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:18646:26:js错误:无法解析ItemsComponent:的所有参数 ts版本2.1.6 xcode版本8.2.1 tns平台声明:^2.5.0, tns ios:

如何复制:

tns创造一些东西-ng cd什么的

下面是链接

npm安装tns平台声明-保存开发

替换了tsconfig.json和reference.d.ts的内容

tns运行iOS

我要走了

file:///app/tns_modules/@angular/compiler/bundles/compiler.umd.js:18646:26:js错误:无法解析ItemsComponent:的所有参数

ts版本2.1.6 xcode版本8.2.1 tns平台声明:^2.5.0, tns ios:{版本:2.5.0} nativescript angular:1.4.0

如果没有这些修改,iOS项目将按预期运行


我认为这与引用有关,但我不确定。

在启用Angular-2的项目中工作时,需要处理一些与DOM相关的类型。这将在下一版本的nativescript dev typescript中讨论,但同时,请在参考资料中使用以下内容

// <reference path="./node_modules/tns-core-modules/tns-core-modules.es2016.d.ts" />

/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

declare type Comment = any;
declare type CloseEvent = any;
declare type Document = any;
declare type DocumentFragment = any;
declare type Element = any;
declare type History = any;
declare type HTMLAnchorElement = any;
declare type HTMLCollection = any;
declare type HTMLDocument = any;
declare type HTMLElement = any;
declare type HTMLInputElement = any;
declare type HTMLScriptElement = any;
declare type HTMLStyleElement = any;
declare type KeyboardEvent = any;
declare type Location = any;
declare type MessageEvent = any;
declare type MouseEvent = any;
declare type Node = any;
declare type NodeList = any;
declare type Text = any;
declare type WebSocket = any;

基于

在启用Angular-2的项目中工作时,需要处理一些与DOM相关的类型。这将在下一版本的nativescript dev typescript中讨论,但同时,请在参考资料中使用以下内容

// <reference path="./node_modules/tns-core-modules/tns-core-modules.es2016.d.ts" />

/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />

declare type Comment = any;
declare type CloseEvent = any;
declare type Document = any;
declare type DocumentFragment = any;
declare type Element = any;
declare type History = any;
declare type HTMLAnchorElement = any;
declare type HTMLCollection = any;
declare type HTMLDocument = any;
declare type HTMLElement = any;
declare type HTMLInputElement = any;
declare type HTMLScriptElement = any;
declare type HTMLStyleElement = any;
declare type KeyboardEvent = any;
declare type Location = any;
declare type MessageEvent = any;
declare type MouseEvent = any;
declare type Node = any;
declare type NodeList = any;
declare type Text = any;
declare type WebSocket = any;

基于

同时根据链接更改tsconfig。同时根据链接更改tsconfig。