-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Angular src restructured as modular as per angular official guideline…
…s, .travis.yml support added for node 12
- Loading branch information
Showing
26 changed files
with
184 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ os: | |
- osx | ||
language: node_js | ||
node_js: | ||
- '12' | ||
- '11' | ||
- '10' | ||
dist: xenial | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.background": "#c26c93", | ||
"activityBar.foreground": "#15202b", | ||
"activityBar.inactiveForeground": "#15202b99", | ||
"activityBarBadge.background": "#acd08e", | ||
"activityBarBadge.foreground": "#15202b" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { HomeComponent } from './components/home/home.component'; | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { PageNotFoundComponent } from './shared/components'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: HomeComponent | ||
} | ||
{ | ||
path: '', | ||
redirectTo: 'home', | ||
pathMatch: 'full' | ||
}, | ||
{ | ||
path: '**', | ||
component: PageNotFoundComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes, {useHash: true})], | ||
exports: [RouterModule] | ||
imports: [RouterModule.forRoot(routes, { useHash: true })], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { } | ||
export class AppRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
import 'reflect-metadata'; | ||
import '../polyfills'; | ||
|
||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
|
||
import { HttpClientModule, HttpClient } from '@angular/common/http'; | ||
import { CoreModule } from './core/core.module'; | ||
import { SharedModule } from './shared/shared.module'; | ||
|
||
import { AppRoutingModule } from './app-routing.module'; | ||
|
||
// NG Translate | ||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; | ||
import { TranslateHttpLoader } from '@ngx-translate/http-loader'; | ||
|
||
import { ElectronService } from './providers/electron.service'; | ||
|
||
import { WebviewDirective } from './directives/webview.directive'; | ||
import { HomeModule } from './home/home.module'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { HomeComponent } from './components/home/home.component'; | ||
|
||
// AoT requires an exported function for factories | ||
export function HttpLoaderFactory(http: HttpClient) { | ||
return new TranslateHttpLoader(http, './assets/i18n/', '.json'); | ||
} | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AppComponent, | ||
HomeComponent, | ||
WebviewDirective | ||
], | ||
declarations: [AppComponent], | ||
imports: [ | ||
BrowserModule, | ||
FormsModule, | ||
HttpClientModule, | ||
CoreModule, | ||
SharedModule, | ||
HomeModule, | ||
AppRoutingModule, | ||
TranslateModule.forRoot({ | ||
loader: { | ||
provide: TranslateLoader, | ||
useFactory: (HttpLoaderFactory), | ||
useFactory: HttpLoaderFactory, | ||
deps: [HttpClient] | ||
} | ||
}) | ||
], | ||
providers: [ElectronService], | ||
providers: [], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [ | ||
CommonModule | ||
] | ||
}) | ||
export class CoreModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ElectronService } from './electron.service'; | ||
|
||
describe('ElectronService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: ElectronService = TestBed.get(ElectronService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './electron/electron.service'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { HomeComponent } from './home.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'home', | ||
component: HomeComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [CommonModule, RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class HomeRoutingModule {} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { HomeRoutingModule } from './home-routing.module'; | ||
|
||
import { HomeComponent } from './home.component'; | ||
import { SharedModule } from '../shared/shared.module'; | ||
|
||
@NgModule({ | ||
declarations: [HomeComponent], | ||
imports: [CommonModule, SharedModule, HomeRoutingModule] | ||
}) | ||
export class HomeModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './page-not-found/page-not-found.component'; |
3 changes: 3 additions & 0 deletions
3
src/app/shared/components/page-not-found/page-not-found.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
page-not-found works! | ||
</p> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/shared/components/page-not-found/page-not-found.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { PageNotFoundComponent } from './page-not-found.component'; | ||
|
||
describe('PageNotFoundComponent', () => { | ||
let component: PageNotFoundComponent; | ||
let fixture: ComponentFixture<PageNotFoundComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ PageNotFoundComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PageNotFoundComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
src/app/shared/components/page-not-found/page-not-found.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-page-not-found', | ||
templateUrl: './page-not-found.component.html', | ||
styleUrls: ['./page-not-found.component.scss'] | ||
}) | ||
export class PageNotFoundComponent implements OnInit { | ||
constructor() {} | ||
|
||
ngOnInit() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './webview/webview.directive'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { WebviewDirective } from './webview.directive'; | ||
|
||
describe('WebviewDirective', () => { | ||
it('should create an instance', () => { | ||
const directive = new WebviewDirective(); | ||
expect(directive).toBeTruthy(); | ||
}); | ||
}); |
6 changes: 2 additions & 4 deletions
6
src/app/directives/webview.directive.ts → ...d/directives/webview/webview.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: 'webview' | ||
selector: '[webview]' | ||
}) | ||
export class WebviewDirective { | ||
|
||
constructor() { } | ||
|
||
constructor() {} | ||
} |
Oops, something went wrong.