Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit e7ad9ca

Browse files
Merge pull request #180 from btroncone/reorganize
Reorganize into core and material modules
2 parents f65c556 + f1338dd commit e7ad9ca

23 files changed

+200
-141
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"@types/hammerjs": "2.0.35",
4343
"core-js": "2.4.1",
4444
"hammerjs": "2.0.8",
45-
"ngx-clipboard": "8.1.0",
4645
"rxjs": "5.5.2",
4746
"ts-loader": "3.1.1",
4847
"zone.js": "0.8.14"

src/app/app.component.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
44
import { AppComponent } from './app.component';
5-
import { ToolbarModule } from './toolbar/toolbar.module';
65
import { MatSidenavModule, MatListModule } from '@angular/material';
7-
import { SeoService } from './services/seo.service';
6+
import { CoreModule } from './core/core.module';
87

98
describe('AppComponent', () => {
109
let component: AppComponent;
@@ -16,12 +15,11 @@ describe('AppComponent', () => {
1615
imports: [
1716
RouterTestingModule,
1817
BrowserAnimationsModule,
19-
ToolbarModule,
18+
CoreModule.forRoot(),
2019
MatSidenavModule,
2120
MatListModule
2221
],
23-
declarations: [AppComponent],
24-
providers: [SeoService]
22+
declarations: [AppComponent]
2523
}).compileComponents();
2624
})
2725
);

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RouterEvent
77
} from '@angular/router';
88
import { filter, map, mergeMap } from 'rxjs/operators';
9-
import { SeoService, SeoData } from './services/seo.service';
9+
import { SeoService, SeoData } from './core/services/seo.service';
1010

1111
interface Menu {
1212
title: string;

src/app/app.module.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
import { SeoService } from './services/seo.service';
1+
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3+
import { MatSidenavModule, MatListModule } from '@angular/material';
34
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4-
import { NgModule } from '@angular/core';
5+
import { FlexLayoutModule } from '@angular/flex-layout';
56

6-
import { AppComponent } from './app.component';
7-
import { ToolbarModule } from './toolbar/toolbar.module';
8-
import { MatSidenavModule, MatListModule } from '@angular/material';
7+
import { CoreModule } from '../app/core/core.module';
8+
import { MaterialModule } from './material/material.module';
99
import { AppRoutingModule } from './app-routing.module';
1010

11+
import { AppComponent } from './app.component';
12+
1113
@NgModule({
1214
declarations: [AppComponent],
1315
imports: [
1416
BrowserModule,
1517
BrowserAnimationsModule,
16-
ToolbarModule,
17-
MatListModule,
18-
MatSidenavModule,
19-
AppRoutingModule
18+
FlexLayoutModule,
19+
MaterialModule,
20+
AppRoutingModule,
21+
CoreModule.forRoot()
2022
],
21-
providers: [SeoService],
2223
bootstrap: [AppComponent]
2324
})
2425
export class AppModule {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { NgModule } from '@angular/core';
2-
32
import { CompaniesComponent } from './companies.component';
43
import { CompaniesRoutingModule } from './companies-routing.module';
5-
import { SharedModule } from '../shared.module';
6-
import { environment } from '../../environments/environment';
74

85
@NgModule({
9-
imports: [CompaniesRoutingModule, SharedModule],
6+
imports: [CompaniesRoutingModule],
107
declarations: [CompaniesComponent]
118
})
129
export class CompaniesModule {}
File renamed without changes.
File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3+
import { RouterTestingModule } from '@angular/router/testing';
4+
5+
import { ToolbarComponent } from './toolbar.component';
6+
import { MaterialModule } from '../../../material/material.module';
7+
8+
describe('ToolbarComponent', () => {
9+
let component: ToolbarComponent;
10+
let fixture: ComponentFixture<ToolbarComponent>;
11+
12+
beforeEach(
13+
async(() => {
14+
TestBed.configureTestingModule({
15+
imports: [MaterialModule, BrowserAnimationsModule, RouterTestingModule],
16+
declarations: [ToolbarComponent]
17+
}).compileComponents();
18+
})
19+
);
20+
21+
beforeEach(() => {
22+
fixture = TestBed.createComponent(ToolbarComponent);
23+
component = fixture.componentInstance;
24+
fixture.detectChanges();
25+
});
26+
27+
it('should create', () => {
28+
expect(component).toBeTruthy();
29+
});
30+
});

src/app/toolbar/toolbar.component.ts renamed to src/app/core/components/toolbar/toolbar.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Component, OnInit, Output, EventEmitter } from "@angular/core";
1+
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
22

33
@Component({
4-
selector: "app-toolbar",
5-
templateUrl: "./toolbar.component.html",
6-
styleUrls: ["./toolbar.component.scss"]
4+
selector: 'app-toolbar',
5+
templateUrl: './toolbar.component.html',
6+
styleUrls: ['./toolbar.component.scss']
77
})
88
export class ToolbarComponent implements OnInit {
99
@Output() navToggle = new EventEmitter<boolean>();

src/app/core/core.module.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterModule } from '@angular/router';
4+
import { FlexLayoutModule } from '@angular/flex-layout';
5+
6+
import { CopierService } from './services/copier.service';
7+
import { SeoService } from './services/seo.service';
8+
import { ToolbarComponent } from './components/toolbar/toolbar.component';
9+
import { MaterialModule } from '../material/material.module';
10+
11+
@NgModule({
12+
imports: [FlexLayoutModule, RouterModule, CommonModule, MaterialModule],
13+
declarations: [ToolbarComponent],
14+
exports: [ToolbarComponent]
15+
})
16+
export class CoreModule {
17+
static forRoot() {
18+
return {
19+
ngModule: CoreModule,
20+
providers: [CopierService, SeoService]
21+
};
22+
}
23+
}

0 commit comments

Comments
 (0)