我在TypeScript Angular6中使用jQuery时出现以下错误,请帮我
jQuery('#assignsp').modal('show');
Run Code Online (Sandbox Code Playgroud)
遵循这些步骤
3个步骤:
安装jQuery。(如果已安装,请跳过)
npm install jquery --save jQuery的安装类型。
npm install @ types / jquery-保存
Import jQuery in app.module.ts.
import * as $ from 'jquery';
Run Code Online (Sandbox Code Playgroud)
它告诉我错误
错误TS2339:类型“”上不存在属性“模式”JQuery<HTMLElement>
错误TS2339:类型“ JQuery”上不存在属性“模式”。
我面临此错误,当我使用angularjs在IIS中发布我的应用程序时,请帮助我,请帮助我如何使用.net core 2.1和angularjs解决此错误。在Visual Studio正常工作中,我在IIS中遇到此错误
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
});
app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});
Run Code Online (Sandbox Code Playgroud)
错误截图:
