Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Angular 2 Typescript中使用flow.js_Angular_Typescript_Definitelytyped_Flow Js - Fatal编程技术网

在Angular 2 Typescript中使用flow.js

在Angular 2 Typescript中使用flow.js,angular,typescript,definitelytyped,flow-js,Angular,Typescript,Definitelytyped,Flow Js,我想将flowjs或ng flow集成到Angular 2应用程序中 我已经使用 npm install --save-dev @types/flowjs 从 但是当我从'flowjs'在我的组件import{Flow}中导入它时控制台引发了一个错误 /node_modules/@types/flowjs/index.d.ts' is not a module. 我以前在创建自己的模块时遇到这个错误,它是在文件index.d.ts中没有导出类或模块时导致的。我查看了存储库,我的猜测是:错误

我想将flowjs或ng flow集成到Angular 2应用程序中

我已经使用

npm install --save-dev @types/flowjs

但是当我从'flowjs'在我的组件
import{Flow}中导入它时控制台引发了一个错误

/node_modules/@types/flowjs/index.d.ts' is not a module.

我以前在创建自己的模块时遇到这个错误,它是在文件index.d.ts中没有导出类或模块时导致的。我查看了存储库,我的猜测是:错误的原因是文件中没有导出任何内容。 但与其他定义文件一样,您不需要导入定义,它是全局定义,因此您只需要使用“//ref”操作符将其添加到编译器生命周期中。
我不习惯这种新的类型脚本定义文件方法(@types),但有一篇帖子很好地解释了如何将其添加到编译器生命周期中:

import*作为流从“@flowjs/Flow.js”

Try
import*作为流从“flowjs”
我收到了相同的错误消息
/node\u modules/@types/flowjs/index.d.ts'不是模块。
。嗨,伙计,你成功地将flow.js与Angular 2集成了吗?我是新的ot ng2,需要一些步骤方面的帮助。我已经安装了flowjs打字。是的,我已经按照angular cli的方式完成了,你们可以在上阅读更多内容。你们有什么样的例子吗?我无法将函数绑定到事件属性,例如
flow files submitted=“function()”
。谢谢!我是Angular 2的新手,我将阅读更多关于新打字机的定义。我的荣幸!我从一年多前的alpha 27开始使用Angular,这是微软应用于定义文件的第三种方法。第一个是tsd,第二个是打字,最后一个是“@types”。这两个操作符首先使用“//ref”操作符来识别定义文件,但在“@types”中它似乎有所不同。正如我所说,我不习惯使用“@types”。应该是一个注释。