Skip to content

Commit

Permalink
Angular Navbar (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchirico authored Apr 3, 2020
1 parent 151834f commit 7bf30dd
Show file tree
Hide file tree
Showing 29 changed files with 11,331 additions and 4 deletions.
16 changes: 16 additions & 0 deletions angular/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@




# Angular

```
ng g component navbar/navbar
ng g component navpages/auth
ng g component navpages/page0
ng g component navpages/page1
ng g component navpages/main
ng g component navpages/search
```


This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.0.

## Development server
Expand Down
16 changes: 15 additions & 1 deletion angular/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {AuthComponent} from './navpages/auth/auth.component';
import {MainComponent} from './navpages/main/main.component';
import {Page0Component} from './navpages/page0/page0.component';
import {Page1Component} from './navpages/page1/page1.component';
import {SearchComponent} from './navpages/search/search.component';

const routes: Routes = [
{path: '', redirectTo: '/main', pathMatch: 'full'},
{path: 'main', component: MainComponent},
{path: 'page0', component: Page0Component},
{path: 'page1', component: Page1Component},
{path: 'auth', component: AuthComponent},
{path: 'search', component: SearchComponent}

];


const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
Expand Down
7 changes: 6 additions & 1 deletion angular/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<app-navbar></app-navbar>
<div class="container">
<div class="row">
<router-outlet></router-outlet>
</div>
</div>
<div class="content" role="main">
<span>{{ title }} app is running!</span>
</div>
<router-outlet></router-outlet>
14 changes: 13 additions & 1 deletion angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AuthComponent } from './navpages/auth/auth.component';
import { Page0Component } from './navpages/page0/page0.component';
import { Page1Component } from './navpages/page1/page1.component';
import { MainComponent } from './navpages/main/main.component';
import { SearchComponent } from './navpages/search/search.component';
import { NavbarComponent } from './navbar/navbar/navbar.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
AuthComponent,
Page0Component,
Page1Component,
MainComponent,
SearchComponent,
NavbarComponent
],
imports: [
BrowserModule,
Expand Down
Empty file.
29 changes: 29 additions & 0 deletions angular/src/app/navbar/navbar/navbar.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" routerLink="/main">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarColor03">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" routerLink="/main">Main <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/page0">Page0</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/page1">Page1</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/auth">Auth</a>
</li>

</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search">
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>

25 changes: 25 additions & 0 deletions angular/src/app/navbar/navbar/navbar.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 { NavbarComponent } from './navbar.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navbar/navbar/navbar.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-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Empty file.
1 change: 1 addition & 0 deletions angular/src/app/navpages/auth/auth.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>auth works!</p>
25 changes: 25 additions & 0 deletions angular/src/app/navpages/auth/auth.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 { AuthComponent } from './auth.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navpages/auth/auth.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-auth',
templateUrl: './auth.component.html',
styleUrls: ['./auth.component.css']
})
export class AuthComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Empty file.
1 change: 1 addition & 0 deletions angular/src/app/navpages/main/main.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>main works!</p>
25 changes: 25 additions & 0 deletions angular/src/app/navpages/main/main.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 { MainComponent } from './main.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navpages/main/main.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-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css']
})
export class MainComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Empty file.
1 change: 1 addition & 0 deletions angular/src/app/navpages/page0/page0.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>page0 works!</p>
25 changes: 25 additions & 0 deletions angular/src/app/navpages/page0/page0.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 { Page0Component } from './page0.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navpages/page0/page0.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-page0',
templateUrl: './page0.component.html',
styleUrls: ['./page0.component.css']
})
export class Page0Component implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Empty file.
1 change: 1 addition & 0 deletions angular/src/app/navpages/page1/page1.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>page1 works!</p>
25 changes: 25 additions & 0 deletions angular/src/app/navpages/page1/page1.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 { Page1Component } from './page1.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navpages/page1/page1.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-page1',
templateUrl: './page1.component.html',
styleUrls: ['./page1.component.css']
})
export class Page1Component implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Empty file.
1 change: 1 addition & 0 deletions angular/src/app/navpages/search/search.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>search works!</p>
25 changes: 25 additions & 0 deletions angular/src/app/navpages/search/search.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 { SearchComponent } from './search.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
15 changes: 15 additions & 0 deletions angular/src/app/navpages/search/search.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-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.css']
})
export class SearchComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Loading

0 comments on commit 7bf30dd

Please sign in to comment.