Add router and homepage
This commit is contained in:
parent
589333e565
commit
67ddf4b663
30
src/app/app-material.module.ts
Normal file
30
src/app/app-material.module.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatInputModule, MatNativeDateModule, MatSnackBarModule, MatTooltipModule } from '@angular/material';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
|
||||
@NgModule( {
|
||||
exports: [
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatTableModule,
|
||||
MatInputModule,
|
||||
MatFormFieldModule,
|
||||
MatExpansionModule,
|
||||
MatSnackBarModule,
|
||||
MatDatepickerModule,
|
||||
MatNativeDateModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
]
|
||||
} )
|
||||
export class AppMaterialModule {
|
||||
}
|
85
src/app/app-routing.module.ts
Normal file
85
src/app/app-routing.module.ts
Normal file
@ -0,0 +1,85 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { HomeComponent } from './home/home.component';
|
||||
|
||||
const routes: Routes = [
|
||||
// No logged pages
|
||||
{ path: '', component: HomeComponent, },
|
||||
// {
|
||||
// path: 'login',
|
||||
// component: LoginComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Créez-vous ou connectez-vous à votre compte',
|
||||
// description: 'Venez vous créer un compte sur notre platforme, grâce à notre application web et mobile vous serez prêt pour tout' +
|
||||
// 'les cas de figure',
|
||||
// noindex: true,
|
||||
// nofollow: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'verification/:id',
|
||||
// component: VerificationComponent,
|
||||
// data: {
|
||||
// noindex: true,
|
||||
// nofollow: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'password/:id',
|
||||
// component: PasswordComponent,
|
||||
// data: {
|
||||
// noindex: true,
|
||||
// nofollow: true,
|
||||
// },
|
||||
// },
|
||||
//
|
||||
// // Logged pages
|
||||
// {
|
||||
// path: 'dashboard',
|
||||
// component: DashboardComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Mom dashboard',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'vehicles',
|
||||
// component: CarsComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Mes véhicules',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'reports',
|
||||
// component: ReportsComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Mes constat',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'reports/:id',
|
||||
// component: ReportDetailsComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Détail d\'un constat',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'profile',
|
||||
// component: ProfileComponent,
|
||||
// canActivate: [ AuthGuard ],
|
||||
// data: {
|
||||
// title: 'Mon Profil',
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
||||
@NgModule( {
|
||||
imports: [ RouterModule.forRoot( routes ) ],
|
||||
exports: [ RouterModule ]
|
||||
} )
|
||||
export class AppRoutingModule {
|
||||
}
|
@ -1,21 +1 @@
|
||||
<!--The content below is only a placeholder and can be replaced.-->
|
||||
<div style="text-align:center">
|
||||
<h1>
|
||||
Welcome to {{ title }}!
|
||||
</h1>
|
||||
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
|
||||
</div>
|
||||
<h2>Here are some links to help you start: </h2>
|
||||
<ul>
|
||||
<li>
|
||||
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
|
||||
</li>
|
||||
<app-test></app-test>
|
||||
</ul>
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
|
@ -4,21 +4,28 @@ import { ErrorHandler, NgModule } from '@angular/core';
|
||||
import { AppComponent } from './app.component';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
import { HomeComponent } from './home/home.component';
|
||||
|
||||
import { AngularFireModule } from '@angular/fire';
|
||||
import { AngularFireDatabaseModule } from '@angular/fire/database';
|
||||
import { environment } from '@env/environment';
|
||||
import { GlobalErrorHandler } from '@app/core/global-error-handler/global-error-handler.service';
|
||||
import { LogService } from '@app/core/services';
|
||||
import { AppMaterialModule } from '@app/app-material.module';
|
||||
import { AppRoutingModule } from '@app/app-routing.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HomeComponent,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
AppRoutingModule,
|
||||
AngularFireModule.initializeApp(environment.firebaseConfig),
|
||||
AngularFireDatabaseModule,
|
||||
AppMaterialModule,
|
||||
],
|
||||
providers: [
|
||||
LogService,
|
||||
|
0
src/app/home/home.component.css
Normal file
0
src/app/home/home.component.css
Normal file
3
src/app/home/home.component.html
Normal file
3
src/app/home/home.component.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
Welcome in our home page
|
||||
</div>
|
25
src/app/home/home.component.spec.ts
Normal file
25
src/app/home/home.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
15
src/app/home/home.component.ts
Normal file
15
src/app/home/home.component.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.css']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user