我发现自己处于相当困难的状态,我似乎无法解决它。我想要做的是在我的Angular2项目中导入Articulate.js,但我似乎无法使它工作。我已经在index.html和angular-cli中导入了脚本,但是每次我点击speak按钮它都会告诉我:
speak is not defined at HTMLButtonElement.onclick
This is the source code for the Articulate.js
speak.js
function speak(obj) {
$(obj).articulate('speak');
};
function pause() {
$().articulate('pause');
};
function resume() {
$().articulate('resume');
};
function stop() {
$().articulate('stop');
};
app.component.ts
import '../../../assets/speak.js';
import '../../../assets/articulate.min.js';
import '../../../assets/jquery.min.js';
declare var articulate: any;
declare var speak: any;
app.html
<div class="articulate-area">
<button onclick="speak('div.card')">Speak Intro</button>
</div>