0

I am using the Angular 19 Full Calendar component. I have a dedicated Angular Workspace I use to develop the Angular component, I am using ng build --configuration development to deploy the component files to my ASP.NET Core MVC's wwwroot directory.

wwwroot in ASP.NET Core MVC application

I have set the baseUrl for the component files in the index.html file of the Angular component

<base href="/dist/fullcalendar-examples/angular19/browser/index.html">

I am serving the component and requisite js files in my ASP.NET Core MVC view:

@{
    ViewData["Title"] = "Index";
    Layout = "_Layout";
}

<h1>Index</h1>

<app-root></app-root>

<script src="/scheduling/calendar/browser/polyfills.js" type="module"></script>
<script src="/scheduling/calendar/browser/main.js" type="module"></script>

Now to my GREAT surprise, the component is correctly loading in my layout, and everything is working just fine! I can add events to the calendar, the calendars post/put/get calls to my ASP.NET Core MVC controller are all working just fine. My mind is blown that this works at all!

Here is my only issue so far, I think Angular is 'eating' my URL.

The ASP.NET Core MVC area/controller/action that serves this view is https://localhost:7225/Scheduling/

The correct action is called and the view returned which includes the Angular component BUT the URL gets truncated to https://localhost:7225.

I don't understand this behavior or what/where is causing it. Being relatively new to Angular, I was hoping someone here could point me in a direction as to how to tell angular to leave my URL alone (HEY TEACHER, leave my URL alone!).

I have not defined any routing at all in Angular and I don't think I need any. I have an Angular micro service whose job is to provide all the communication with ASP.NET Core MVC controller and that functionality is working just fine.

1 Answer 1

0

It turns out that if you include ANY routing definitions at all in your component it will eat your URL and use its internal URL. I removed any routing references, then I pointed my index page to the 'deployed' location in my MVC solution:

  <base href="/wwwroot/scheduling/calendar/browser/">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.