Components and rearranging

This commit is contained in:
GloriousCode
2017-08-22 18:24:24 +10:00
parent d805149619
commit d1753b85b0
16 changed files with 68 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
import { HomeComponent } from './components/home/home.component';
import { AboutComponent } from './components/about/about.component';
import { HomeComponent } from './pages/home/home.component';
import { AboutComponent } from './pages/about/about.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

View File

@@ -1,20 +1,2 @@
<!-- TODO: figure out if the <nav> should go inside of a <header> element. -->
<nav class="docs-navbar">
<md-toolbar color="primary">
<a md-button class="docs-button" routerLink="/" aria-label="Angular Material">
<span>Logo</span>
</a>
<a md-button class="docs-button" routerLink="about">Dashboard</a>
<a md-button class="docs-button" routerLink="about">Wallet Summary</a>
<a md-button class="docs-button" routerLink="about">Settings</a>
<a md-button class="docs-button" routerLink="about">Help</a>
<div class="flex-spacer"></div>
<a md-button class="docs-button" href="https://github.com/angular/material2" aria-label="GitHub Repository">
GitHub
</a>
</md-toolbar>
</nav>
<app-navbar></app-navbar>
<router-outlet></router-outlet>

View File

@@ -4,7 +4,7 @@ import { ElectronService } from './providers/electron.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
constructor(public electronService: ElectronService) {

View File

@@ -10,18 +10,20 @@ import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
import { AboutComponent } from './components/about/about.component';
import { HomeComponent } from './pages/home/home.component';
import { AboutComponent } from './pages/about/about.component';
import { AppRoutingModule } from './app-routing.module';
import { ElectronService } from './providers/electron.service';
import { NavbarComponent } from './shared/navbar/navbar.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
AboutComponent
AboutComponent,
NavbarComponent
],
imports: [
BrowserModule,

View File

@@ -4,3 +4,4 @@
</h1>
<a routerLink="/about" routerLinkActive="active" >hello</a>
</div>

View File

@@ -3,7 +3,8 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
title = `App works !`;

View File

@@ -0,0 +1,16 @@
<!-- TODO: figure out if the <nav> should go inside of a <header> element. -->
<nav class="docs-navbar">
<md-toolbar color="primary">
<a md-button class="docs-button" routerLink="/" aria-label="Angular Material">
<span>Logo</span>
</a>
<a md-button class="docs-button" routerLink="about">Dashboard</a>
<a md-button class="docs-button" routerLink="about">Wallet Summary</a>
<a md-button class="docs-button" routerLink="about">Settings</a>
<a md-button class="docs-button" routerLink="about">Help</a>
<div class="flex-spacer"></div>
<a md-button class="docs-button" href="https://github.com/thrasher-/gocryptotrader/issues" aria-label="GitHub Repository">
Report issue
</a>
</md-toolbar>
</nav>

View File

@@ -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 be created', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss']
})
export class NavbarComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}