mirror of
https://github.com/Raghu-Ch/weirdbeard.life.git
synced 2026-02-10 04:33:02 -05:00
Add basic routing & angular material, upgrade CLI version
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Weirdbeard is a web application featuring search for beard styles, best products for beard care, finding nearest beard barber and discussion board for the registered customers.
|
Weirdbeard is a web application featuring search for beard styles, best products for beard care, finding nearest beard barber and discussion board for the registered customers.
|
||||||
|
|
||||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.3.
|
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.6.
|
||||||
|
|
||||||
## prerequisites
|
## prerequisites
|
||||||
|
|
||||||
Angular, Typescript, Nodejs, Bootstrap.
|
Angular, Typescript, Nodejs, Angular-Material.
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
"@angular/common": "^4.0.0",
|
"@angular/common": "^4.0.0",
|
||||||
"@angular/compiler": "^4.0.0",
|
"@angular/compiler": "^4.0.0",
|
||||||
"@angular/core": "^4.0.0",
|
"@angular/core": "^4.0.0",
|
||||||
|
"@angular/flex-layout": "^2.0.0-beta.8",
|
||||||
"@angular/forms": "^4.0.0",
|
"@angular/forms": "^4.0.0",
|
||||||
"@angular/http": "^4.0.0",
|
"@angular/http": "^4.0.0",
|
||||||
"@angular/material": "^2.0.0-beta.5",
|
"@angular/material": "^2.0.0-beta.5",
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
"zone.js": "^0.8.4"
|
"zone.js": "^0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "1.0.3",
|
"@angular/cli": "^1.0.6",
|
||||||
"@angular/compiler-cli": "^4.0.0",
|
"@angular/compiler-cli": "^4.0.0",
|
||||||
"@types/hammerjs": "^2.0.34",
|
"@types/hammerjs": "^2.0.34",
|
||||||
"@types/jasmine": "2.5.38",
|
"@types/jasmine": "2.5.38",
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { HomeComponent } from 'app/home/home.component';
|
||||||
|
import { PageNotFoundComponent } from 'app/pagenotfound/pagenotfound.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{ path: 'home', component: HomeComponent },
|
||||||
path: '',
|
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
||||||
children: []
|
{ path: '**', component: PageNotFoundComponent }
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<h1>
|
<!--<h1>
|
||||||
{{title}}
|
{{title}}
|
||||||
</h1>
|
</h1>-->
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
|||||||
@@ -6,10 +6,14 @@ import { HttpModule } from '@angular/http';
|
|||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { MaterialdesignModule } from 'app/materialdesign/materialdesign.module';
|
import { MaterialdesignModule } from 'app/materialdesign/materialdesign.module';
|
||||||
|
import { HomeComponent } from './home/home.component';
|
||||||
|
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent,
|
||||||
|
HomeComponent,
|
||||||
|
PageNotFoundComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
|||||||
0
src/app/home/home.component.css
Normal file
0
src/app/home/home.component.css
Normal file
1
src/app/home/home.component.html
Normal file
1
src/app/home/home.component.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h2>home page</h2>
|
||||||
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 be created', () => {
|
||||||
|
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: 'wb-home',
|
||||||
|
templateUrl: './home.component.html',
|
||||||
|
styleUrls: ['./home.component.css']
|
||||||
|
})
|
||||||
|
export class HomeComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { MaterialModule } from '@angular/material';
|
import { MaterialModule } from '@angular/material';
|
||||||
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import 'hammerjs';
|
import 'hammerjs';
|
||||||
|
|
||||||
@@ -8,10 +9,12 @@ import 'hammerjs';
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MaterialModule,
|
MaterialModule,
|
||||||
|
FlexLayoutModule,
|
||||||
BrowserAnimationsModule
|
BrowserAnimationsModule
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
MaterialModule,
|
MaterialModule,
|
||||||
|
FlexLayoutModule,
|
||||||
BrowserAnimationsModule
|
BrowserAnimationsModule
|
||||||
],
|
],
|
||||||
declarations: []
|
declarations: []
|
||||||
|
|||||||
16
src/app/pagenotfound/pagenotfound.component.ts
Normal file
16
src/app/pagenotfound/pagenotfound.component.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'wb-pagenotfound',
|
||||||
|
template: `
|
||||||
|
<p>
|
||||||
|
<md-icon class="warning">warning</md-icon><span class="spacer">Page not found!</span>
|
||||||
|
</p>
|
||||||
|
`,
|
||||||
|
styles: [`
|
||||||
|
.warning { font-size: 30px;}
|
||||||
|
.spacer { margin-left: 10px;}
|
||||||
|
`
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class PageNotFoundComponent { }
|
||||||
Reference in New Issue
Block a user