Skip to content

Commit

Permalink
Base version
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Braillard committed Nov 4, 2018
1 parent 21358f3 commit e6f409e
Show file tree
Hide file tree
Showing 17 changed files with 177 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .angulardoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"repoId": "f5df9430-00db-4713-9cf3-6a6b6fbc935f",
"lastSync": 0
}
9 changes: 9 additions & 0 deletions src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
a {
text-decoration: none;
color: black;
margin-right: 10px;
}

a.current {
font-weight: bold;
}
21 changes: 8 additions & 13 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ <h1>
</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://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
</li>
</ul>

<hr/>
<div>
<a [routerLink]="['home']" routerLinkActive="current">Home</a>
<a [routerLink]="['foo']" routerLinkActive="current">Foo</a>
<a [routerLink]="['bar']" routerLinkActive="current">Bar</a>
</div>
<hr/>
<router-outlet></router-outlet>
19 changes: 17 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { FooComponent } from './foo/foo.component';
import { BarComponent } from './bar/bar.component';
import { HomeComponent } from './home/home.component';


const appRoutes: Routes = [
{ path: 'home', component: HomeComponent},
{ path: 'foo', component: FooComponent},
{ path: 'bar', component: BarComponent},
{ path: '', redirectTo: 'home', pathMatch: 'full' }
];

@NgModule({
declarations: [
AppComponent
AppComponent,
FooComponent,
BarComponent,
HomeComponent
],
imports: [
RouterModule.forRoot(appRoutes, { enableTracing: true}),
BrowserModule
],
providers: [],
Expand Down
Empty file added src/app/bar/bar.component.css
Empty file.
3 changes: 3 additions & 0 deletions src/app/bar/bar.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>
bar works!
</p>
25 changes: 25 additions & 0 deletions src/app/bar/bar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { BarComponent } from './bar.component';

describe('BarComponent', () => {
let component: BarComponent;
let fixture: ComponentFixture<BarComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BarComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(BarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions src/app/bar/bar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-bar',
templateUrl: './bar.component.html',
styleUrls: ['./bar.component.css']
})
export class BarComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
Empty file added src/app/foo/foo.component.css
Empty file.
5 changes: 5 additions & 0 deletions src/app/foo/foo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p>
foo works!
</p>

<button (click)="goHome()">Go Home</button>
25 changes: 25 additions & 0 deletions src/app/foo/foo.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { FooComponent } from './foo.component';

describe('FooComponent', () => {
let component: FooComponent;
let fixture: ComponentFixture<FooComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FooComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(FooComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
19 changes: 19 additions & 0 deletions src/app/foo/foo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
selector: 'app-foo',
templateUrl: './foo.component.html',
styleUrls: ['./foo.component.css']
})
export class FooComponent implements OnInit {

constructor(private router: Router) { }

ngOnInit() {
}

goHome() {
this.router.navigate(['home']);
}
}
Empty file added src/app/home/home.component.css
Empty file.
3 changes: 3 additions & 0 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>
home works!
</p>
25 changes: 25 additions & 0 deletions src/app/home/home.component.spec.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -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() {
}

}
4 changes: 4 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* You can add global styles to this file, and also import other style files */

body {
font-family: Arial, Helvetica, sans-serif;
}

0 comments on commit e6f409e

Please sign in to comment.