Skip to content

Commit b65efa7

Browse files
AbrarJahinMarkPieszak
authored andcommitted
SignalR server side ipmlemented (TrilonIO#52)
Closes TrilonIO#39 * Remove Websocket so that it can be replaced with SignalR * Adding signalR package and remove websocket * - Add package for SignalR and remove package for websocket - Configure SignalR in Startup.cs - Remove unused packages * SignalR hub added * - Readme added for adding a route - Added 404 page - Update readme file - Add un-necessery files to ignore list * SignalR UI added * Fabicon Updated to make it showing Angular2 Fabicon * SignalR library added
1 parent 04af248 commit b65efa7

24 files changed

+254
-147
lines changed

Angular2Spa.xproj

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,22 @@
1212
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
1313
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1414
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15-
</PropertyGroup>
15+
</PropertyGroup>
1616
<PropertyGroup>
1717
<SchemaVersion>2.0</SchemaVersion>
1818
</PropertyGroup>
19+
<ItemGroup>
20+
<DnxInvisibleFolder Include=".awcache\" />
21+
<DnxInvisibleFolder Include=".git\" />
22+
<DnxInvisibleFolder Include=".vscode\" />
23+
<DnxInvisibleFolder Include=".vs\" />
24+
<DnxInvisibleFolder Include="docs\" />
25+
</ItemGroup>
26+
<ItemGroup>
27+
<DnxInvisibleContent Include="CHANGELOG.md" />
28+
<DnxInvisibleContent Include="Dockerfile" />
29+
<DnxInvisibleContent Include="LICENSE.md" />
30+
<DnxInvisibleContent Include="README.md" />
31+
</ItemGroup>
1932
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
2033
</Project>

Client/app/app.routes.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { Route } from '@angular/router';
1+
import { Route } from '@angular/router';
22

33
// Container (aka: "pages") imports
44
import {
55
HomeComponent,
66
RestTestComponent,
77
BootstrapComponent,
88
LoginComponent,
9-
ExamplesComponent
9+
ExamplesComponent,
10+
ChatComponent,
11+
NotFoundComponent
1012
} from 'app-containers';
1113

1214
export const ROUTES: Route[] = [
@@ -19,6 +21,8 @@ export const ROUTES: Route[] = [
1921
{ path: 'rest-test', component: RestTestComponent, data: { title: 'WebAPI Examples'} },
2022
{ path: 'login', component: LoginComponent, data: { title: 'Login'} },
2123
{ path: 'examples', component: ExamplesComponent, data: { title: 'Platform Examples'} },
24+
{ path: 'chat', component: ChatComponent, data: { title: 'Chat' } },
25+
{ path: 'not-found', component: NotFoundComponent, data: { title: '404 - Not Found' } },
2226

2327
{ // ** LAZY-LOADING EXAMPLE **
2428
// Notice we don't reference the file anywhere else, imports, declarations, anywhere
@@ -34,5 +38,5 @@ export const ROUTES: Route[] = [
3438
// loadChildren: '../containers/+faq/faq.module#FAQModule' },
3539

3640
// All else fails - go home
37-
{ path: '**', redirectTo: 'home' }
41+
{ path: '**', redirectTo: 'not-found' }
3842
];

Client/app/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ export * from './state/app.reducer';
2020
export * from './state/app-state';
2121
export * from './state/hmr';
2222

23-
export * from './shared-module/base.shared.module';
24-
23+
export * from './shared-module/base.shared.module';

Client/app/platform-modules/app.browser.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function getResponse() {
5252
// Other providers you want to add that you don't want shared in "Common" but are browser only
5353
]
5454
})
55+
5556
export class AppBrowserModule {
5657

5758
constructor(public cache: CacheService) {

Client/app/platform-modules/app.common.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* _Common_ NgModule to share between our "BASE" App.Browser & App.Server module platforms
43
*
@@ -27,7 +26,9 @@ import {
2726
RestTestComponent,
2827
BootstrapComponent,
2928
LoginComponent,
30-
ExamplesComponent
29+
ExamplesComponent,
30+
ChatComponent,
31+
NotFoundComponent
3132
} from 'app-containers';
3233

3334
// Provider (aka: "shared" | "services") imports
@@ -79,6 +80,8 @@ const COMPONENTS = [
7980
LoginComponent,
8081
BootstrapComponent,
8182
ExamplesComponent,
83+
ChatComponent,
84+
NotFoundComponent,
8285

8386
// Directives
8487
RxContextDirective

Client/app/platform-modules/app.server.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function getResponse() {
4545
// Other providers you want to add that you don't want shared in "Common" but are browser only
4646
]
4747
})
48+
4849
export class AppServerModule {
4950

5051
constructor(public cache: CacheService) { }

Client/components/navmenu/navmenu.component.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
<i class="fa fa-chrome" aria-hidden="true"></i> RestAPI Demo
2020
</a>
2121
</li>
22+
<li [routerLinkActive]="['link-active']">
23+
<a [routerLink]="['/chat']">
24+
<i class="fa fa-comments-o" aria-hidden="true"></i> SignalR Chat
25+
</a>
26+
</li>
27+
<li [routerLinkActive]="['link-active']">
28+
<a [routerLink]="['/video-chat']">
29+
<i class="fa fa-video-camera" aria-hidden="true"></i> WebRTC Video Chat
30+
</a>
31+
</li>
2232
<li [routerLinkActive]="['link-active']">
2333
<a [routerLink]="['/faq']">
2434
<i class="fa fa-question-circle" aria-hidden="true"></i> FAQ
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SignalR Chat example will go here
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Component, OnInit, Inject } from '@angular/core';
2+
3+
4+
@Component({
5+
selector: 'app-chat',
6+
templateUrl: './chat.component.html'
7+
})
8+
export class ChatComponent implements OnInit
9+
{
10+
// Use "constructor"s only for dependency injection
11+
constructor (@Inject('isBrowser') private isBrowser: boolean) {
12+
// Example of how to Inject the isBrowser/isNode we injected in our app.browser & app.server NgModules
13+
}
14+
15+
// Here you want to handle anything with @Input()'s @Output()'s
16+
// Data retrieval / etc - this is when the Component is "ready" and wired up
17+
ngOnInit ()
18+
{
19+
console.log('Are we inside the Browser ? ' + this.isBrowser);
20+
}
21+
}

Client/containers/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ export * from './home/home.component';
1717
export * from './bootstrap/bootstrap.component';
1818
export * from './login/login.component';
1919
export * from './platform-examples/examples.component';
20+
export * from './not-found/not-found.component';
21+
export * from './chat/chat.component';

0 commit comments

Comments
 (0)