Add a new Angular app with 4 components
This commit is contained in:
0
Front/skydivelogs-app/src/app/app.component.css
Normal file
0
Front/skydivelogs-app/src/app/app.component.css
Normal file
7
Front/skydivelogs-app/src/app/app.component.html
Normal file
7
Front/skydivelogs-app/src/app/app.component.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<nav>
|
||||
<a routerLink="/summary" routerLinkActive="active">Summary</a>
|
||||
<a routerLink="/jumpsList" routerLinkActive="active">List of jumps</a>
|
||||
<a routerLink="/dz" routerLinkActive="active">List of DZs</a>
|
||||
<a routerLink="/newjump" routerLinkActive="active">Add a new jumps</a>
|
||||
</nav>
|
||||
<router-outlet></router-outlet>
|
||||
27
Front/skydivelogs-app/src/app/app.component.spec.ts
Normal file
27
Front/skydivelogs-app/src/app/app.component.spec.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { TestBed, async } from '@angular/core/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
}).compileComponents();
|
||||
}));
|
||||
it('should create the app', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
}));
|
||||
it(`should have as title 'app'`, async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app.title).toEqual('app');
|
||||
}));
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
|
||||
}));
|
||||
});
|
||||
10
Front/skydivelogs-app/src/app/app.component.ts
Normal file
10
Front/skydivelogs-app/src/app/app.component.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'app';
|
||||
}
|
||||
49
Front/skydivelogs-app/src/app/app.module.ts
Normal file
49
Front/skydivelogs-app/src/app/app.module.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { SummaryComponent } from './summary/summary.component';
|
||||
import { ListOfJumpsComponent } from './list-of-jumps/list-of-jumps.component';
|
||||
import { ListOfDzsComponent } from './list-of-dzs/list-of-dzs.component';
|
||||
import { NewJumpComponent } from './new-jump/new-jump.component';
|
||||
|
||||
|
||||
const appRoutes: Routes = [
|
||||
{ path: 'summary', component: SummaryComponent },
|
||||
{ path: 'jumpsList', component: ListOfJumpsComponent },
|
||||
{ path: 'dz', component: ListOfDzsComponent },
|
||||
{ path: 'newjump', component: NewJumpComponent }
|
||||
// { path: 'hero/:id', component: HeroDetailComponent },
|
||||
// {
|
||||
// path: 'heroes',
|
||||
// component: HeroListComponent,
|
||||
// data: { title: 'Heroes List' }
|
||||
// },
|
||||
// { path: '',
|
||||
// redirectTo: '/heroes',
|
||||
// pathMatch: 'full'
|
||||
// },
|
||||
// { path: '**', component: PageNotFoundComponent }
|
||||
];
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
SummaryComponent,
|
||||
ListOfJumpsComponent,
|
||||
ListOfDzsComponent,
|
||||
NewJumpComponent
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forRoot(
|
||||
appRoutes,
|
||||
{ enableTracing: true } // <-- debugging purposes only
|
||||
),
|
||||
BrowserModule
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule { }
|
||||
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
list-of-dzs works!
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ListOfDzsComponent } from './list-of-dzs.component';
|
||||
|
||||
describe('ListOfDzsComponent', () => {
|
||||
let component: ListOfDzsComponent;
|
||||
let fixture: ComponentFixture<ListOfDzsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ListOfDzsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ListOfDzsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-dzs',
|
||||
templateUrl: './list-of-dzs.component.html',
|
||||
styleUrls: ['./list-of-dzs.component.css']
|
||||
})
|
||||
export class ListOfDzsComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
list-of-jumps works!
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ListOfJumpsComponent } from './list-of-jumps.component';
|
||||
|
||||
describe('ListOfJumpsComponent', () => {
|
||||
let component: ListOfJumpsComponent;
|
||||
let fixture: ComponentFixture<ListOfJumpsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ListOfJumpsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ListOfJumpsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-jumps',
|
||||
templateUrl: './list-of-jumps.component.html',
|
||||
styleUrls: ['./list-of-jumps.component.css']
|
||||
})
|
||||
export class ListOfJumpsComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
new-jump works!
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NewJumpComponent } from './new-jump.component';
|
||||
|
||||
describe('NewJumpComponent', () => {
|
||||
let component: NewJumpComponent;
|
||||
let fixture: ComponentFixture<NewJumpComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NewJumpComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NewJumpComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts
Normal file
15
Front/skydivelogs-app/src/app/new-jump/new-jump.component.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-jump',
|
||||
templateUrl: './new-jump.component.html',
|
||||
styleUrls: ['./new-jump.component.css']
|
||||
})
|
||||
export class NewJumpComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
summary works!
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SummaryComponent } from './summary.component';
|
||||
|
||||
describe('SummaryComponent', () => {
|
||||
let component: SummaryComponent;
|
||||
let fixture: ComponentFixture<SummaryComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SummaryComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SummaryComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
Front/skydivelogs-app/src/app/summary/summary.component.ts
Normal file
15
Front/skydivelogs-app/src/app/summary/summary.component.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-summary',
|
||||
templateUrl: './summary.component.html',
|
||||
styleUrls: ['./summary.component.css']
|
||||
})
|
||||
export class SummaryComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user