-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref/ make app reloading/working with and without usehash routing stra…
…tegy
- Loading branch information
Maxime GRIS
committed
Apr 20, 2020
1 parent
0994e6c
commit 386ce67
Showing
18 changed files
with
167 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
|
||
} |
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,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { DetailComponent } from './detail.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'detail', | ||
component: DetailComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [CommonModule, RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class DetailRoutingModule {} |
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,7 @@ | ||
<div class="container"> | ||
<h1 class="title"> | ||
{{ 'PAGES.DETAIL.TITLE' | translate }} | ||
</h1> | ||
|
||
<a routerLink="/">{{ 'PAGES.DETAIL.BACK_TO_HOME' | translate }}</a> | ||
</div> |
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,3 @@ | ||
:host { | ||
|
||
} |
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,35 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DetailComponent } from './detail.component'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
|
||
import { RouterTestingModule } from '@angular/router/testing'; | ||
|
||
describe('DetailComponent', () => { | ||
let component: DetailComponent; | ||
let fixture: ComponentFixture<DetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [DetailComponent], | ||
imports: [TranslateModule.forRoot(), RouterTestingModule] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('should render title in a h1 tag', async(() => { | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain( | ||
'PAGES.DETAIL.TITLE' | ||
); | ||
})); | ||
}); |
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,14 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-detail', | ||
templateUrl: './detail.component.html', | ||
styleUrls: ['./detail.component.scss'] | ||
}) | ||
export class DetailComponent implements OnInit { | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { DetailRoutingModule } from './detail-routing.module'; | ||
|
||
import { DetailComponent } from './detail.component'; | ||
import { SharedModule } from '../shared/shared.module'; | ||
|
||
@NgModule({ | ||
declarations: [DetailComponent], | ||
imports: [CommonModule, SharedModule, DetailRoutingModule] | ||
}) | ||
export class DetailModule {} |
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 |
---|---|---|
@@ -1,16 +1,3 @@ | ||
.container { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
background: url(../../assets/background.jpg) no-repeat center fixed; | ||
-webkit-background-size: cover; /* pour anciens Chrome et Safari */ | ||
background-size: cover; /* version standardisée */ | ||
|
||
.title { | ||
color: white; | ||
margin: 0; | ||
padding: 50px 20px; | ||
} | ||
} | ||
:host { | ||
|
||
} |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{ | ||
"PAGES": { | ||
"HOME": { | ||
"TITLE": "App works !" | ||
} | ||
"TITLE": "App works !", | ||
"GO_TO_DETAIL": "Go to Detail" | ||
}, | ||
"DETAIL": { | ||
"TITLE": "Detail page !", | ||
"BACK_TO_HOME": "Back to Home" | ||
} | ||
} | ||
} |
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