angular - 在 connectionStrings 标记中,将执行 Angular 脚本的服务器名称写为数据源并保存
问题描述
我正在学习角度编程,并且正在研究“服务”主题以及如何使用 HttpClient 获取数据。那里有提到我不明白的这条线。该行显示“在 connectionStrings 标记中,将执行 angular 脚本的服务器名称写为数据源并保存”。在执行 Angular 脚本的地方写下服务器名称是什么意思?我正在使用 Visual Studio 代码来运行程序,并且输出/网页是在 chrome 浏览器上生成的。我使用的端口是 localhost:4200。直到现在我还没有使用任何数据库服务器来获取数据,一切都是硬编码的。我应该怎么做才能进一步进行?
web.config 文件
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings></appSettings>
<connectionStrings>
<add name="QuickKartDBContext" connectionString="metadata=res://*/QuickKartModel.csdl|res://*/QuickKartModel.ssdl|res://*/QuickKartModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=QuickKartDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.6.2"/>
<httpRuntime targetFramework="4.6.2"/>
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<remove name="OPTIONSVerbHandler"/>
<remove name="TRACEVerbHandler"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type,Origin,Accept" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>
解决方案
推荐阅读
- python - 如何在 python 中将这些字符串与正则表达式匹配
- asp.net - CharJs 使用 Razor
- xml - xsltproc合并xml文件不起作用
- jenkins - 检查 Jenkins 节点是否为作业在线,否则发送电子邮件警报
- python - Python:转换日期时间格式
- angular - 使用 Angular 材质创建移动底部导航
- linux-kernel - 如何在 linux 中查看和跟踪与子系统相关的内核更改,比如 I2C
- unity3d - Unity - 儿童旋转和缩放错误
- python - 布尔掩码 Tensorflow,tf.boolean_mask - 保持原始张量的尺寸
- python-3.x - 如何将凭据添加到 Google 文本到语音 API?