我制作了一个边栏,导航到'home‘和'search’页面。但是,我想要的是,我只需要在‘主页’页面上显示边栏,而不需要在‘搜索’页面上显示。我现在拥有的是:
App.js
import React from "react";
import "./App.css";
import SideBar from "./components/SideBar";
import Home from "./screens/Home";
import Search from "./screens/Search";
在Visual Studio中,我有两个应用程序。一个是Angular 2网站,另一个是WebApi项目。我在WebAPI方法中有一个断点,当Angular服务尝试检索数据但页面上什么也没有显示时,就会命中该断点。打开浏览器控制台,我得到以下错误:
XMLHttpRequest cannot load http://localhost:58949/api/people. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhos