找不到名字'Handlebars'

时间:2018-03-16 12:10:38

标签: javascript typescript handlebars.js

我正在尝试使用Typescript中的把手。我收到以下错误

/// <reference path="../../../jquery.d.ts" />
/// <reference path="../../../require.d.ts" />

我无法理清如何引用车把定义文件以使其正常工作

private populateData(data){
    var base=this;
    var jsData=document.getElementById('header').innerHTML;
    var getdata=document.getElementById('header').innerHTML;
    var compiledData = Handlebars.compile(getdata);
    $('.displayData').html(compiledData(data));
}

错误:dev / include / ts / test.ts(43,48):错误TS2304:找不到名称'Handlebars'

包括@ types / handlebar

import * as Handlebars from 'handlebars';

获得以下错误

>> handlebars.d.ts(21,31): error TS1005: ',' expected.
>> handlebars.d.ts(23,32): error TS1005: ',' expected.
>> handlebars.d.ts(98,40): error TS1005: ',' expected.

0 个答案:

没有答案