我有一个整数列表,我想制作一个字符串.
var xs = list(1,2,3,4,5)
(xs foldLeft "") (_+_) // String = 12345
Run Code Online (Sandbox Code Playgroud)
使用foldLeft它完美,但我的问题是它是否也适用于reduceLeft?如果是,怎么样?
我有一个.tsx文件并通过ts文件导入它
import {ReactChildComponentView} from "./MessageBox";
Run Code Online (Sandbox Code Playgroud)
但是当我运行服务时它会抛出一个错误
ERROR in ./src/app/react/wrapper.component.ts
Module not found: Error: Can't resolve './MessageBox' in '.../src/app/react'
Run Code Online (Sandbox Code Playgroud)
在Chrome控制台中,我可以看到以下错误
using description file: .../package.json (relative path: ./src/app/react/MessageBox)
as directory
.../src/app/react/MessageBox doesn't exist
no extension
.../src/app/react/MessageBox doesn't exist
.ts
.../src/app/react/MessageBox.ts doesn't exist
.js
.../src/app/react/MessageBox.js doesn't exist
Run Code Online (Sandbox Code Playgroud)
看起来像angular不会找.tsx文件.我怎么能改变呢?