mdc模块的typescript导入错误

时间:2017-04-30 08:44:58

标签: angular typescript web material-components

我是TypeScript的新手。我无法导入mdc-checkbox中描述的function mutation(arr) { var first = arr[0].toLowerCase(); var second = arr[1].toLowerCase(); return first.indexOf(second) !== -1; } console.log(mutation(["zyxwvutsrqponmlkjihgfedcba", "jihg"])); console.log(mutation(["hello", "ell"]));

我该怎么做才能解决此错误?

docs

1 个答案:

答案 0 :(得分:0)

抱歉,找到解释
哈哈,非常简单

// Since we don't have typings (yet) we require mdc-checkbox manually.
const {MDCCheckboxFoundation} = require('@material/checkbox');