Skip to content

Commit

Permalink
Imported Blazor web components into Angular project
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenoage committed Nov 8, 2023
1 parent 6331c62 commit f51cc79
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
{
"glob": "**/*",
"input": "../Blazor/bin/Debug/net7.0/publish/wwwroot",
"output": ".",
"ignore": ["index.html"]
}
],
"styles": [
"src/styles.css"
Expand Down
2 changes: 1 addition & 1 deletion Angular/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const routes: Routes = [

@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
exports: [ RouterModule ],
})
export class AppRoutingModule {}
3 changes: 3 additions & 0 deletions Angular/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<blazor-counter></blazor-counter>
<!--
<h1>{{title}}</h1>
<nav>
<a routerLink="/dashboard">Dashboard</a>
<a routerLink="/heroes">Heroes</a>
</nav>
<router-outlet></router-outlet>
<app-messages></app-messages>
-->
5 changes: 3 additions & 2 deletions Angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
Expand Down Expand Up @@ -37,6 +37,7 @@ import { MessagesComponent } from './messages/messages.component';
MessagesComponent,
HeroSearchComponent
],
bootstrap: [ AppComponent ]
bootstrap: [ AppComponent ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
})
export class AppModule { }
2 changes: 2 additions & 0 deletions Angular/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="BlazorComponents.styles.css">
<script src="_framework/blazor.webassembly.js"></script>
</head>
<body>
<app-root></app-root>
Expand Down

0 comments on commit f51cc79

Please sign in to comment.