-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
This demo in this section is created using the ng command.
The source code for this demo can be found inside AngularFrontend. A really cool thing is that we are hosting an ASP.NET backend with our Blazor components, along with an Angular frontend and a React frontend, all running on the same backend within Aspire.
There is no need to run NPM or anything like that. Aspire will run that for you.
By default, Angular will be upset when we add our custom element because it does not recognize the tag. To fix this, we need to tell Angular that we are using custom elements. In the AngularFrontend/src/app/app.ts, add the following things:
import { …… , CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
A bit further down in the same file, add:
schemas: [
CUSTOM_ELEMENTS_SCHEMA // Tells Angular we will have custom tags
// in our templates
]
Now Angular is okay with having custom elements.
Next, it's time...