Skip to content

Commit 1e40211

Browse files
authored
Merge pull request #18 from magic-software-lab/updating-dependecies
Updating dependencies and add feature to navigate directly to specific demo page
2 parents 7e64ec1 + 8a3d118 commit 1e40211

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

demo/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"core-js": "^2.4.1",
2626
"font-awesome": "^4.7.0",
2727
"ng2-page-scroll": "^4.0.0-beta.8",
28-
"ngx-bootstrap": "^1.6.6",
28+
"ngx-bootstrap": "^1.7.1",
2929
"ngx-clipboard": "^8.0.2",
3030
"ngx-infinite-scroll": "^0.5.1",
3131
"rxjs": "^5.1.0",
@@ -34,8 +34,8 @@
3434
"devDependencies": {
3535
"@angular/cli": "1.0.4",
3636
"@angular/compiler-cli": "^4.1.3",
37-
"@types/jasmine": "2.5.38",
38-
"@types/node": "~6.0.60",
37+
"@types/jasmine": "2.5.49",
38+
"@types/node": "^7.0.28",
3939
"codelyzer": "~2.0.0",
4040
"jasmine-core": "~2.5.2",
4141
"jasmine-spec-reporter": "~3.2.0",
@@ -47,7 +47,7 @@
4747
"karma-jasmine-html-reporter": "^0.2.2",
4848
"protractor": "~5.1.0",
4949
"ts-node": "~2.0.0",
50-
"tslint": "~4.5.0",
51-
"typescript": "~2.2.0"
50+
"tslint": "^5.4.3",
51+
"typescript": "^2.2.1"
5252
}
5353
}

demo/src/app/demos-page/demos-page.component.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit, ViewChild, ViewContainerRef, ComponentFactoryResolver } from '@angular/core';
2+
import { ActivatedRoute } from '@angular/router';
23

34
import { PrettifyWrapperService } from '../shared/shared.module';
45

@@ -23,43 +24,62 @@ export class DemosPageComponent implements OnInit {
2324
public demoActivate: any;
2425
public demos = [
2526
{
27+
id: 'simple',
2628
title: 'Simple',
2729
component: SimpleDemoSectionComponent
2830
},
2931
{
32+
id: 'sort',
3033
title: 'Sort',
3134
component: SortDemoSectionComponent
3235
},
3336
{
37+
id: 'alignment',
3438
title: 'Alignment',
3539
component: AlignDemoSectionComponent
3640
},
3741
{
42+
id: 'formatting',
3843
title: 'Formatting',
3944
component: FormattingDemoSectionComponent
4045
},
4146
{
47+
id: 'simple-button',
4248
title: 'Simple button',
4349
component: SimpleButtonDemoSectionComponent
4450
},
4551
{
46-
title: 'Button group',
52+
id: 'button-group',
53+
title: 'Button Group',
4754
component: ButtonGroupDemoSectionComponent
4855
},
4956
{
57+
id: 'dropdown',
5058
title: 'Dropdown',
5159
component: DropdownDemoSectionComponent
5260
}
5361
];
5462

63+
5564
private demoComponent: any;
5665

5766
constructor(
58-
private componentFactoryResolver: ComponentFactoryResolver,
67+
private componentFactoryResolver: ComponentFactoryResolver,
68+
private route: ActivatedRoute,
5969
private prettify: PrettifyWrapperService) { }
6070

6171
ngOnInit() {
6272
this.changeDemo(this.demos[0]);
73+
74+
this.route.queryParams.subscribe(params => {
75+
if (params['id']) {
76+
const demoId = params['id'];
77+
const demoActivate = this.demos.find((demo) => demo.id === demoId);
78+
if (demoActivate) {
79+
this.changeDemo(demoActivate);
80+
}
81+
}
82+
});
6383
}
6484

6585
changeDemo(demo: any) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"systemjs": "^0.20.12",
111111
"tslint": "^5.4.2",
112112
"tslint-jasmine-rules": "^1.3.0",
113-
"typescript": "^2.2.1",
113+
"typescript": "^2.3.4",
114114
"zone.js": "^0.8.4"
115115
}
116116
}

0 commit comments

Comments
 (0)