我正在使用打字本编写一个angular2(rc-5)应用程序。我刚刚制作了一个加载器组件,它只需在类型记录类函数中使用jquery打开模式。但是它不能建立$和模态函数?
import { Component, Input } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'app-loader',
templateUrl: 'loader.component.html',
styleUrls: ['loader.component.css']
})
export class LoaderComponent {
constructor() { }
@Input() message = "finally inside child scope.";
showLoader(){
$("#loaderModal").modal('show'); // error on this line
}
}错误报告:在'ElementFinder‘类型上不存在错误:-属性'modal’。

谢谢你帮忙。
发布于 2016-08-25 12:39:40
这是运行时错误还是编译错误?
如果是编译错误,则需要安装输入:
安装jquery和引导typings install dt~jquery dt~bootstrap --global --save的类型
有关键入的更多信息,请在这里找到:https://github.com/typings/typings
如果是运行时错误,则应该将jquery和引导程序导入到类型记录文件中。你用什么ModuleLoader?
发布于 2016-08-26 06:45:31
你是否已声明$的其他含义:
声明var $:JQueryStatic;
https://stackoverflow.com/questions/39144984
复制相似问题