这是app.module.ts
我试图在不同的项目中完成导入地图,它工作正常,但在这个项目中,它不起作用.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {HttpModule} from '@angular/http';
import { AppComponent } from './app.component';
import { PagesComponent } from './pages/pages.component';
@NgModule({
declarations: [
AppComponent,
PagesComponent
],
imports: [
BrowserModule,
HttpModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import { Component } from '@angular/core';
import {PageService} from './page.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ["../assets/public/css/adminstyle.css",
"../assets/public/css/demo.css",
"../assets/public/css/style.css"
,"../assets/public/css/stylesheet.css"],
providers:[PageService]
})
export class AppComponent {
title …
Run Code Online (Sandbox Code Playgroud) 这是我的 Startup.cs 文件
这是我在 Startup.cs 中的 ConfigureService 方法我已经完全根据文档对其进行了修改但它不起作用我已经删除了启动网址所以它只是在端口上并且我没有设置任何路由我在他的帮助下遇到了麻烦受到赞赏
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddControllers();
services.ConnectionToACQEs(Configuration);
services.AddAutoMapper(typeof(Startup));
// Register the Swagger generator, defining 1 or more Swagger documents
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo
{
Version = "v1",
Title = "ToDo API",
Description = "A simple example ASP.NET Core Web API",
TermsOfService = new Uri("https://example.com/terms"),
Contact = new OpenApiContact
{
Name = "Nicky Liu",
Email = "nicky@zedotech.com",
Url = new Uri("https://www.zedotech.com"),
},
License = new OpenApiLicense
{
Name = "Use …
Run Code Online (Sandbox Code Playgroud)