Skip to content

Commit 4ed9696

Browse files
authored
Merge pull request coreui#12 from damingerdai/develop
Develop
2 parents cddbea1 + 93ad2cc commit 4ed9696

File tree

115 files changed

+3627
-3804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3627
-3804
lines changed

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
"build": "ng build --prod",
88
"test": "ng test",
99
"lint": "ng lint",
10-
"e2e": "ng e2e",
11-
"precommit": "ng lint daming-core-ui && sass-lint -v -q",
10+
"e2e": "ng e2e",
11+
"precommit": "ng lint daming-core-ui && sass-lint -v -q",
1212
"sass": "sass-lint -v -q",
1313
"push": "ng build --prod --base-href ./ && npx angular-cli-ghpages --dir=dist/daming-core-ui "
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^7.2.13",
18-
"@angular/common": "~7.2.13",
19-
"@angular/compiler": "~7.2.13",
20-
"@angular/core": "~7.2.13",
21-
"@angular/forms": "~7.2.13",
22-
"@angular/platform-browser": "~7.2.13",
23-
"@angular/platform-browser-dynamic": "~7.2.13",
24-
"@angular/router": "~7.2.13",
17+
"@angular/animations": "^7.2.15",
18+
"@angular/common": "~7.2.15",
19+
"@angular/compiler": "~7.2.15",
20+
"@angular/core": "~7.2.15",
21+
"@angular/forms": "~7.2.15",
22+
"@angular/platform-browser": "~7.2.15",
23+
"@angular/platform-browser-dynamic": "~7.2.15",
24+
"@angular/router": "~7.2.15",
2525
"@coreui/angular": "^2.2.3",
2626
"@coreui/coreui": "^2.1.6",
2727
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0",
@@ -37,16 +37,16 @@
3737
"ngx-bootstrap": "^3.1.4",
3838
"ngx-perfect-scrollbar": "^7.2.0",
3939
"ngx-toastr": "^9.1.1",
40-
"rxjs": "~6.4.0",
40+
"rxjs": "~6.5.1",
4141
"simple-line-icons": "^2.4.1",
4242
"tslib": "^1.9.0",
4343
"zone.js": "~0.8.29"
4444
},
4545
"devDependencies": {
4646
"@angular-devkit/build-angular": "~0.12.0",
47-
"@angular/cli": "~7.3.8",
48-
"@angular/compiler-cli": "~7.2.13",
49-
"@angular/language-service": "~7.2.13",
47+
"@angular/cli": "~7.3.9",
48+
"@angular/compiler-cli": "~7.2.15",
49+
"@angular/language-service": "~7.2.15",
5050
"@types/jasmine": "~2.8.8",
5151
"@types/jasminewd2": "~2.0.3",
5252
"@types/node": "~8.9.4",
@@ -65,4 +65,4 @@
6565
"tslint": "~5.11.0",
6666
"typescript": "~3.2.2"
6767
}
68-
}
68+
}

src/app/app.component.spec.ts

+23-23
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@ import { TestBed, async } from '@angular/core/testing';
22
import { AppComponent } from './app.component';
33

44
describe('AppComponent', () => {
5-
beforeEach(async(() => {
6-
TestBed.configureTestingModule({
7-
declarations: [
8-
AppComponent
9-
],
10-
}).compileComponents();
11-
}));
5+
beforeEach(async(() => {
6+
TestBed.configureTestingModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
}).compileComponents();
11+
}));
1212

13-
it('should create the app', () => {
14-
const fixture = TestBed.createComponent(AppComponent);
15-
const app = fixture.debugElement.componentInstance;
16-
expect(app).toBeTruthy();
17-
});
13+
it('should create the app', () => {
14+
const fixture = TestBed.createComponent(AppComponent);
15+
const app = fixture.debugElement.componentInstance;
16+
expect(app).toBeTruthy();
17+
});
1818

19-
it(`should have as title 'daming-core-ui'`, () => {
20-
const fixture = TestBed.createComponent(AppComponent);
21-
const app = fixture.debugElement.componentInstance;
22-
expect(app.title).toEqual('daming-core-ui');
23-
});
19+
it(`should have as title 'daming-core-ui'`, () => {
20+
const fixture = TestBed.createComponent(AppComponent);
21+
const app = fixture.debugElement.componentInstance;
22+
expect(app.title).toEqual('daming-core-ui');
23+
});
2424

25-
it('should render title in a h1 tag', () => {
26-
const fixture = TestBed.createComponent(AppComponent);
27-
fixture.detectChanges();
28-
const compiled = fixture.debugElement.nativeElement;
29-
expect(compiled.querySelector('h1').textContent).toContain('Welcome to daming-core-ui!');
30-
});
25+
it('should render title in a h1 tag', () => {
26+
const fixture = TestBed.createComponent(AppComponent);
27+
fixture.detectChanges();
28+
const compiled = fixture.debugElement.nativeElement;
29+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to daming-core-ui!');
30+
});
3131
});

src/app/app.component.ts

+26-26
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ import { setTheme } from 'ngx-bootstrap/utils';
55
import { filter, map, mergeMap } from 'rxjs/operators';
66

77
@Component({
8-
selector: 'app-root',
9-
templateUrl: './app.component.html',
10-
styleUrls: ['./app.component.scss']
8+
selector: 'app-root',
9+
templateUrl: './app.component.html',
10+
styleUrls: ['./app.component.scss']
1111
})
1212
export class AppComponent implements OnInit {
1313

14-
title = 'damingerdai-ui';
14+
title = 'damingerdai-ui';
1515

16-
constructor(
17-
private titleService: Title,
18-
private router: Router,
19-
private activatedRoute: ActivatedRoute
20-
) {
21-
setTheme('bs4'); // or 'bs3'
22-
}
16+
constructor(
17+
private titleService: Title,
18+
private router: Router,
19+
private activatedRoute: ActivatedRoute
20+
) {
21+
setTheme('bs4'); // or 'bs3'
22+
}
2323

24-
ngOnInit() {
25-
this.router.events
26-
.pipe(
27-
filter(event => event instanceof NavigationEnd),
28-
map(() => this.activatedRoute),
29-
map((route) => {
30-
while (route.firstChild) {
31-
route = route.firstChild;
32-
}
33-
return route;
34-
}),
35-
mergeMap(route => route.data),
36-
map(data => data as { title: string })
37-
).subscribe(event => this.titleService.setTitle(event.title || this.title));
38-
}
24+
ngOnInit() {
25+
this.router.events
26+
.pipe(
27+
filter(event => event instanceof NavigationEnd),
28+
map(() => this.activatedRoute),
29+
map((route) => {
30+
while (route.firstChild) {
31+
route = route.firstChild;
32+
}
33+
return route;
34+
}),
35+
mergeMap(route => route.data),
36+
map(data => data as { title: string })
37+
).subscribe(event => this.titleService.setTitle(event.title || this.title));
38+
}
3939
}

src/app/app.module.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ import { RoutesModule } from './routes/routes.module';
99
import { SharedModule } from './shared/shared.module';
1010

1111
@NgModule({
12-
declarations: [
13-
AppComponent
14-
],
15-
imports: [
16-
BrowserModule,
17-
BrowserAnimationsModule,
18-
HttpClientModule,
19-
CoreModule,
20-
LayoutModule,
21-
RoutesModule,
22-
SharedModule.forRoot(),
23-
],
24-
providers: [],
25-
bootstrap: [AppComponent]
12+
declarations: [
13+
AppComponent
14+
],
15+
imports: [
16+
BrowserModule,
17+
BrowserAnimationsModule,
18+
HttpClientModule,
19+
CoreModule,
20+
LayoutModule,
21+
RoutesModule,
22+
SharedModule.forRoot(),
23+
],
24+
providers: [],
25+
bootstrap: [AppComponent]
2626
})
2727
export class AppModule { }

src/app/core/core.module.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import { throwIfAlreadyLoaded } from './module-import-guard';
55

66

77
@NgModule({
8-
declarations: [],
9-
imports: [
10-
CommonModule
11-
],
12-
providers: [
13-
{
14-
provide: NAV_DATA,
15-
useValue: navItems
16-
},
17-
]
8+
declarations: [],
9+
imports: [
10+
CommonModule
11+
],
12+
providers: [
13+
{
14+
provide: NAV_DATA,
15+
useValue: navItems
16+
},
17+
]
1818
})
1919
export class CoreModule {
20-
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
21-
throwIfAlreadyLoaded(parentModule, 'CoreModule');
22-
}
20+
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
21+
throwIfAlreadyLoaded(parentModule, 'CoreModule');
22+
}
2323
}

src/app/core/module-import-guard.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// https://angular.io/styleguide#!#04-12
22
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
3-
if (parentModule) {
4-
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
5-
}
3+
if (parentModule) {
4+
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
5+
}
66
}

src/app/core/nav/nav.service.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { TestBed } from '@angular/core/testing';
33
import { NavService } from './nav.service';
44

55
describe('NavService', () => {
6-
beforeEach(() => TestBed.configureTestingModule({}));
6+
beforeEach(() => TestBed.configureTestingModule({}));
77

8-
it('should be created', () => {
9-
const service: NavService = TestBed.get(NavService);
10-
expect(service).toBeTruthy();
11-
});
8+
it('should be created', () => {
9+
const service: NavService = TestBed.get(NavService);
10+
expect(service).toBeTruthy();
11+
});
1212
});

src/app/core/nav/nav.service.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import { NavData, NAV_DATA } from '../../routes/nav';
44
import { CoreModule } from '../core.module';
55

66
@Injectable({
7-
providedIn: CoreModule,
7+
providedIn: CoreModule,
88
})
99
export class NavService {
1010

11-
private navs: NavData[];
11+
private navs: NavData[];
1212

13-
private navsSource = new Subject<NavData[]>();
13+
private navsSource = new Subject<NavData[]>();
1414

15-
nav$ = this.navsSource.asObservable();
15+
nav$ = this.navsSource.asObservable();
1616

17-
constructor(@Inject(NAV_DATA) navs: NavData[]) {
18-
this.navs = navs;
19-
}
17+
constructor(@Inject(NAV_DATA) navs: NavData[]) {
18+
this.navs = navs;
19+
}
2020

21-
getNavs() {
22-
return this.navs;
23-
}
21+
getNavs() {
22+
return this.navs;
23+
}
2424
}

src/app/layout/aside/aside.component.spec.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
33
import { AsideComponent } from './aside.component';
44

55
describe('AsideComponent', () => {
6-
let component: AsideComponent;
7-
let fixture: ComponentFixture<AsideComponent>;
6+
let component: AsideComponent;
7+
let fixture: ComponentFixture<AsideComponent>;
88

9-
beforeEach(async(() => {
10-
TestBed.configureTestingModule({
11-
declarations: [ AsideComponent ]
12-
})
13-
.compileComponents();
14-
}));
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [AsideComponent]
12+
})
13+
.compileComponents();
14+
}));
1515

16-
beforeEach(() => {
17-
fixture = TestBed.createComponent(AsideComponent);
18-
component = fixture.componentInstance;
19-
fixture.detectChanges();
20-
});
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(AsideComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
2121

22-
it('should create', () => {
23-
expect(component).toBeTruthy();
24-
});
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
2525
});
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Component, OnInit } from '@angular/core';
22

33
@Component({
4-
selector: 'app-layout-aside',
5-
templateUrl: './aside.component.html',
6-
styleUrls: ['./aside.component.scss']
4+
selector: 'app-layout-aside',
5+
templateUrl: './aside.component.html',
6+
styleUrls: ['./aside.component.scss']
77
})
88
export class AsideComponent implements OnInit {
99

10-
constructor() { }
10+
constructor() { }
1111

12-
ngOnInit() {
13-
}
12+
ngOnInit() {
13+
}
1414

1515
}

0 commit comments

Comments
 (0)