This commit is contained in:
crusader 2019-04-29 23:27:38 +09:00
parent 5c7af1357d
commit b4fc93d607
19 changed files with 234 additions and 52 deletions

28
package-lock.json generated
View File

@ -4044,12 +4044,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -4064,17 +4066,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -4191,7 +4196,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -4203,6 +4209,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -4217,6 +4224,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -4224,12 +4232,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -4248,6 +4258,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -4328,7 +4339,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -4340,6 +4352,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -4461,6 +4474,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",

View File

@ -1,7 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
const routes: Routes = []; const routes: Routes = [
{
path: '',
loadChildren: './page/main/main.page.module#MainPageModule'
}
];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes)], imports: [RouterModule.forRoot(routes)],

View File

@ -0,0 +1,23 @@
import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { reducers, metaReducers, effects } from './store';
import { EffectsModule } from '@ngrx/effects';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../environments/environment';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
@NgModule({
declarations: [],
imports: [
StoreModule.forRoot(reducers, { metaReducers }),
StoreDevtoolsModule.instrument({
maxAge: 25,
logOnly: environment.production
}),
StoreRouterConnectingModule.forRoot(),
EffectsModule.forRoot(effects)
],
providers: []
})
export class AppStoreModule {}

View File

@ -1,37 +1 @@
<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:center">
<h1>Welcome to {{ title }}!</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://angular.io/cli"
>CLI Documentation</a
>
</h2>
</li>
<li>
<h2>
<a target="_blank" rel="noopener" href="https://blog.angular.io/"
>Angular blog <button mat-button>Click me!</button></a
>
</h2>
</li>
</ul>
<odds-crawler-commons-material></odds-crawler-commons-material>
<odds-crawler-layout-default></odds-crawler-layout-default>
<router-outlet></router-outlet> <router-outlet></router-outlet>

View File

@ -1,19 +1,23 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { OddsCrawlerFrontendCommonModule } from '@odds-crawler/common'; import { OddsCrawlerFrontendCommonModule } from '@odds-crawler/common';
import { OddsCrawlerFrontendLayoutModule } from '@odds-crawler/layout'; import { OddsCrawlerFrontendLayoutModule } from '@odds-crawler/layout';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppStoreModule } from './app-store.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
imports: [ imports: [
BrowserModule, BrowserModule,
AppRoutingModule, BrowserAnimationsModule,
OddsCrawlerFrontendCommonModule, OddsCrawlerFrontendCommonModule,
OddsCrawlerFrontendLayoutModule OddsCrawlerFrontendLayoutModule,
AppRoutingModule,
AppStoreModule
], ],
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]

View File

@ -0,0 +1,3 @@
import { MainPageComponent } from './main.page.component';
export const COMPONENTS = [MainPageComponent];

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,33 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { MainPageComponent } from './main.page.component';
describe('MainPageComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [MainPageComponent]
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(MainPageComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'odds-crawler-frontend-app'`, () => {
const fixture = TestBed.createComponent(MainPageComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('odds-crawler-frontend-app');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(MainPageComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain(
'Welcome to odds-crawler-frontend-app!'
);
});
});

View File

@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'odds-crawler-app-page-main',
templateUrl: './main.page.component.html',
styleUrls: ['./main.page.component.scss']
})
export class MainPageComponent {
title = 'odds-crawler-frontend-app';
}

View File

@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MainLayoutComponent } from '@odds-crawler/layout';
import { MainPageComponent } from './component/main.page.component';
const routes: Routes = [
{
path: '',
component: MainLayoutComponent,
children: [
{
path: '',
component: MainPageComponent
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MainRoutingPageModule {}

View File

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { OddsCrawlerFrontendCommonModule } from '@odds-crawler/common';
import { OddsCrawlerFrontendLayoutModule } from '@odds-crawler/layout';
import { COMPONENTS } from './component';
import { MainRoutingPageModule } from './main-routing.page.module';
@NgModule({
imports: [
CommonModule,
TranslateModule,
OddsCrawlerFrontendCommonModule,
OddsCrawlerFrontendLayoutModule,
MainRoutingPageModule
],
declarations: [...COMPONENTS]
})
export class MainPageModule {}

View File

@ -0,0 +1,20 @@
import { Type } from '@angular/core';
import {
ActionReducer,
ActionReducerMap,
createFeatureSelector,
createSelector,
MetaReducer
} from '@ngrx/store';
import { environment } from '../../environments/environment';
export interface State {}
export const reducers: ActionReducerMap<State> = {};
export const metaReducers: MetaReducer<State>[] = !environment.production
? []
: [];
export const effects: Type<any>[] = [];

View File

@ -0,0 +1,17 @@
<mat-tab-group>
<mat-tab label="First">
<ng-template matTabContent>
Content 1
</ng-template>
</mat-tab>
<mat-tab label="Second">
<ng-template matTabContent>
Content 2
</ng-template>
</mat-tab>
<mat-tab label="Third">
<ng-template matTabContent>
Content 3
</ng-template>
</mat-tab>
</mat-tab-group>

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MainLayoutComponent } from './main-layout.component';
describe('layout.MainLayoutComponent', () => {
let component: MainLayoutComponent;
let fixture: ComponentFixture<MainLayoutComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [MainLayoutComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MainLayoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,12 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'odds-crawler-layout-main',
templateUrl: './main-layout.component.html',
styles: ['./main-layout.component.scss']
})
export class MainLayoutComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@ -1,11 +1,16 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { DefaultLayoutComponent } from './component/default-layout.component'; import { CommonModule } from '@angular/common';
import { OddsCrawlerFrontendCommonModule } from '@odds-crawler/common'; import { OddsCrawlerFrontendCommonModule } from '@odds-crawler/common';
import { DefaultLayoutComponent } from './component/default-layout.component';
import { MainLayoutComponent } from './component/main-layout.component';
export const COMPONENTS = [DefaultLayoutComponent, MainLayoutComponent];
@NgModule({ @NgModule({
declarations: [DefaultLayoutComponent], declarations: [...COMPONENTS],
imports: [OddsCrawlerFrontendCommonModule], imports: [CommonModule, OddsCrawlerFrontendCommonModule],
exports: [DefaultLayoutComponent] exports: [...COMPONENTS]
}) })
export class OddsCrawlerFrontendLayoutModule {} export class OddsCrawlerFrontendLayoutModule {}

View File

@ -4,4 +4,5 @@
export * from './lib/service/odds-crawler-frontend-layout.service'; export * from './lib/service/odds-crawler-frontend-layout.service';
export * from './lib/component/default-layout.component'; export * from './lib/component/default-layout.component';
export * from './lib/component/main-layout.component';
export * from './lib/layout.module'; export * from './lib/layout.module';