-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding routing pages to different components
- Loading branch information
1 parent
667cc3a
commit 3255d76
Showing
21 changed files
with
1,899 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { WrapperEditorComponent } from './wrapper-editor/wrapper-editor.component'; | ||
import { FluidParentComponent } from './fluid-parent/fluid-parent.component'; | ||
import { LibraryComponentsComponent } from './library-components/library-components.component'; | ||
import { TestPagesComponent } from './test-pages/test-pages.component'; | ||
import { AuthGuard } from './auth.guard'; | ||
|
||
const routes: Routes = [ | ||
{ path: '', component: TestPagesComponent }, // Default route | ||
{ path: 'text-editor', component: WrapperEditorComponent }, | ||
{ path: 'fluid-form', component: FluidParentComponent,canActivate: [AuthGuard] }, | ||
{ path: 'library-components', component: LibraryComponentsComponent }, | ||
{ path: 'fluid-card', component: TestPagesComponent }, | ||
{ path: '**', redirectTo: '', pathMatch: 'full' } // Fallback route | ||
]; | ||
|
||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [ | ||
CommonModule, | ||
RouterModule.forRoot(routes) | ||
], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
<div>Angular Application with StencilJS web components</div> | ||
<h1>from local running stencilJS app</h1> | ||
<app-wrapper-editor></app-wrapper-editor> | ||
<test-button>Click!</test-button> | ||
|
||
<test-counter></test-counter> | ||
|
||
<div *ngIf="this.innerText">{{ this.innerText }}</div> | ||
|
||
<fluid-card title="" collapsible="false" remove-header-border> | ||
<!-- Your FLUID Components Here! --> | ||
<fluid-datepicker [validation]="validation"> </fluid-datepicker> | ||
</fluid-card> | ||
<app-fluid-parent></app-fluid-parent> | ||
|
||
<h1>navigation links</h1> | ||
<nav style="display: flex; flex-direction: column; gap: 10px;"> | ||
<a routerLink="/" routerLinkActive="active">Home</a> | ||
<a routerLink="/fluid-form" routerLinkActive="active">FLUID Form</a> | ||
<a routerLink="/text-editor" routerLinkActive="active">Editor</a> | ||
<a routerLink="/library-components" routerLinkActive="active">LibraryComponents</a> | ||
<a routerLink="/fluid-card" routerLinkActive="active">FLUID Card</a> | ||
</nav> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
nav { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 15px; /* Space between links */ | ||
} | ||
|
||
nav a { | ||
text-decoration: none; | ||
color: inherit; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { AuthGuard } from './auth.guard'; | ||
|
||
describe('AuthGuard', () => { | ||
let guard: AuthGuard; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
guard = TestBed.inject(AuthGuard); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(guard).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree } from '@angular/router'; | ||
import { Observable } from 'rxjs'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AuthGuard implements CanActivate { | ||
canActivate( | ||
route: ActivatedRouteSnapshot, | ||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { | ||
return true; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/app/library-components/library-components.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<p>library-components works!</p> | ||
<h1>from 'stenciljs-components' npm package</h1> | ||
<my-card user-name="CodingLocker"></my-card> | ||
<my-pie-chart data='[{"tag":"height","value":180},{"tag":"weight","value":75},{"tag":"age","value":30},{"tag":"score","value":95},{"tag":"yearsExperience","value":5}]'></my-pie-chart> | ||
<my-rich-text-editor initial-value="this is initial value" placeholder="angular placeholder" font-family="Arial" font-size="26pt"></my-rich-text-editor> | ||
<my-progress-bar value="2" max="10"></my-progress-bar> | ||
<my-progress-ring percentage="30"></my-progress-ring> | ||
<test-button button-id="test-button">Click me!</test-button> | ||
<test-counter>Number: </test-counter> | ||
<search-world search-text="bmw"> </search-world> | ||
<my-payment-gateway></my-payment-gateway> | ||
<my-component first="Sanjeet" last="Kumar"></my-component> | ||
<combo-box [allowInput]="true"></combo-box> | ||
<custom-form></custom-form> | ||
<custom-text-input name="my-custom-input" form-associated></custom-text-input> | ||
<my-button text="Angular Button" (myEvent)="buttonClick($event)"><h5>Hello World</h5></my-button> |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
src/app/library-components/library-components.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LibraryComponentsComponent } from './library-components.component'; | ||
|
||
describe('LibraryComponentsComponent', () => { | ||
let component: LibraryComponentsComponent; | ||
let fixture: ComponentFixture<LibraryComponentsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ LibraryComponentsComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(LibraryComponentsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
src/app/library-components/library-components.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-library-components', | ||
templateUrl: './library-components.component.html', | ||
styleUrls: ['./library-components.component.scss'] | ||
}) | ||
export class LibraryComponentsComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
buttonClick(e:any) { | ||
console.log('custom event', e) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<p>test-pages works!</p> | ||
<fluid-card title="" collapsible="false" remove-header-border> | ||
<!-- Your FLUID Components Here! --> | ||
<fluid-datepicker [validation]="validation"> </fluid-datepicker> | ||
</fluid-card> | ||
|
||
<test-button>Click!</test-button> | ||
|
||
<test-counter></test-counter> | ||
|
||
<div *ngIf="this.innerText">{{ this.innerText }}</div> | ||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TestPagesComponent } from './test-pages.component'; | ||
|
||
describe('TestPagesComponent', () => { | ||
let component: TestPagesComponent; | ||
let fixture: ComponentFixture<TestPagesComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ TestPagesComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TestPagesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, OnInit ,HostListener, EventEmitter,Output} from '@angular/core'; | ||
import { fluid } from '../../main'; | ||
|
||
@Component({ | ||
selector: 'app-test-pages', | ||
templateUrl: './test-pages.component.html', | ||
styleUrls: ['./test-pages.component.scss'] | ||
}) | ||
export class TestPagesComponent implements OnInit { | ||
innerText: string | undefined; | ||
|
||
validation = [ | ||
{ | ||
type: 'custom', | ||
validatorFn: (value: any) => { | ||
return value === '2023-05-23'; | ||
}, | ||
message: 'The value must 2023-05-23', | ||
}, | ||
]; | ||
@HostListener('buttonClicked', ['$event']) | ||
buttonClickHandler(event: any) { | ||
console.log(event); | ||
this.innerText = `Button clicked was: ${event.detail.id}`; | ||
} | ||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters