Skip to content

Commit f51cc79

Browse files
committed
Imported Blazor web components into Angular project
1 parent 6331c62 commit f51cc79

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

Angular/angular.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
"tsConfig": "tsconfig.app.json",
2020
"assets": [
2121
"src/favicon.ico",
22-
"src/assets"
22+
"src/assets",
23+
{
24+
"glob": "**/*",
25+
"input": "../Blazor/bin/Debug/net7.0/publish/wwwroot",
26+
"output": ".",
27+
"ignore": ["index.html"]
28+
}
2329
],
2430
"styles": [
2531
"src/styles.css"

Angular/src/app/app-routing.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ const routes: Routes = [
1414

1515
@NgModule({
1616
imports: [ RouterModule.forRoot(routes) ],
17-
exports: [ RouterModule ]
17+
exports: [ RouterModule ],
1818
})
1919
export class AppRoutingModule {}

Angular/src/app/app.component.html

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
<blazor-counter></blazor-counter>
2+
<!--
13
<h1>{{title}}</h1>
24
<nav>
35
<a routerLink="/dashboard">Dashboard</a>
46
<a routerLink="/heroes">Heroes</a>
57
</nav>
68
<router-outlet></router-outlet>
79
<app-messages></app-messages>
10+
-->

Angular/src/app/app.module.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { FormsModule } from '@angular/forms';
44
import { HttpClientModule } from '@angular/common/http';
@@ -37,6 +37,7 @@ import { MessagesComponent } from './messages/messages.component';
3737
MessagesComponent,
3838
HeroSearchComponent
3939
],
40-
bootstrap: [ AppComponent ]
40+
bootstrap: [ AppComponent ],
41+
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
4142
})
4243
export class AppModule { }

Angular/src/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<base href="/">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
<link rel="stylesheet" href="BlazorComponents.styles.css">
10+
<script src="_framework/blazor.webassembly.js"></script>
911
</head>
1012
<body>
1113
<app-root></app-root>

0 commit comments

Comments
 (0)