Skip to content

Commit f04347c

Browse files
author
Subrat
committed
Merge branch 'release/1.0.0'
* release/1.0.0: Bumped the version from 1.0.0-rc.1 to 1.0.0 Build Added @angular/core to peerDependencies section in package.json Build Build Deleted package-lock.json file Added angular5 tag in package.json Added new method fcRoot Changed base from "/" to ''." Updated package-lock.json
2 parents 146aa0c + c13b4a5 commit f04347c

21 files changed

+10342
-128
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# dependencies
1111
/node_modules
12+
/node_modules_
1213

1314
# IDEs and editors
1415
/.idea

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@ import { NgModule } from '@angular/core';
2929
import * as FusionCharts from 'fusioncharts';
3030
import * as Charts from 'fusioncharts/fusioncharts.charts';
3131
import * as FintTheme from 'fusioncharts/themes/fusioncharts.theme.fint';
32-
33-
import { AppComponent } from './app.component';
3432
import { FusionChartsModule } from 'angular4-fusioncharts';
33+
import { AppComponent } from './app.component';
34+
35+
FusionChartsModule.fcRoot(FusionCharts, Charts, FintTheme);
3536

3637
@NgModule({
3738
declarations: [
3839
AppComponent
3940
],
4041
imports: [
4142
BrowserModule,
42-
FusionChartsModule.forRoot(FusionCharts, Charts, FintTheme)
43+
FusionChartsModule
4344
],
4445
providers: [],
4546
bootstrap: [AppComponent]

dist/dist/index.umd.js

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,41 @@ FusionChartsCoreService.ctorParameters = function () { return []; };
1818
var FusionChartsService = (function () {
1919
function FusionChartsService(fusionChartsCoreService) {
2020
this.fusionChartsCoreService = fusionChartsCoreService;
21-
this._resolveFusionChartsCore();
22-
}
23-
FusionChartsService.prototype._resolveFusionChartsCore = function () {
24-
var _this = this;
25-
if (this.resolvedFusionChartsCore) {
26-
return;
21+
if (!FusionChartsService.isFusionChartsCoreResolved()) {
22+
FusionChartsService.resolveFusionChartsCore(fusionChartsCoreService.core, fusionChartsCoreService.modules);
2723
}
28-
var core$$1 = this.fusionChartsCoreService.core;
29-
var modules = this.fusionChartsCoreService.modules;
30-
if (core$$1.getCurrentRenderer && core$$1.getCurrentRenderer() === 'javascript') {
31-
this.resolvedFusionChartsCore = core$$1;
24+
}
25+
FusionChartsService.getResolvedFusionChartsCore = function () {
26+
return FusionChartsService.resolvedFusionChartsCore;
27+
};
28+
FusionChartsService.isFusionChartsCoreResolved = function () {
29+
return !!FusionChartsService.resolvedFusionChartsCore;
30+
};
31+
FusionChartsService.resolveFusionChartsCore = function (core$$1, modules) {
32+
var resolvedCore;
33+
if (core$$1 && core$$1.getCurrentRenderer && core$$1.getCurrentRenderer() === 'javascript') {
34+
resolvedCore = core$$1;
3235
}
3336
else {
3437
// Otherwise the core should be a factory that provides the fc core.
35-
this.resolvedFusionChartsCore = core$$1();
38+
resolvedCore = core$$1();
3639
}
3740
modules.forEach(function (module) {
38-
module(_this.resolvedFusionChartsCore);
41+
module(resolvedCore);
3942
});
4043
// Fix the black pie-chart rendering in Safari browser.
41-
if (this.resolvedFusionChartsCore.options) {
42-
this.resolvedFusionChartsCore.options.SVGDefinitionURL = 'absolute';
44+
if (resolvedCore.options) {
45+
resolvedCore.options.SVGDefinitionURL = 'absolute';
4346
}
44-
};
45-
FusionChartsService.prototype.getResolvedFusionChartsCore = function () {
46-
return this.resolvedFusionChartsCore;
47+
FusionChartsService.resolvedFusionChartsCore = resolvedCore;
4748
};
4849
FusionChartsService.prototype.newFusionChartsInstance = function (chartConfig) {
49-
return new this.resolvedFusionChartsCore(chartConfig);
50+
var resolvedFCCore = FusionChartsService.resolvedFusionChartsCore;
51+
return new resolvedFCCore(chartConfig);
5052
};
5153
return FusionChartsService;
5254
}());
55+
FusionChartsService.resolvedFusionChartsCore = null;
5356
FusionChartsService.decorators = [
5457
{ type: core.Injectable },
5558
];
@@ -473,21 +476,10 @@ FusionChartsComponent.propDecorators = {
473476
'loadMessageImageScale': [{ type: core.Input },],
474477
};
475478

476-
function provideFusionChartsCoreService(fusionChartsCore, fusionChartsModules) {
477-
return [
478-
{
479-
provide: FusionChartsCoreService,
480-
multi: false,
481-
useValue: {
482-
core: fusionChartsCore,
483-
modules: fusionChartsModules
484-
}
485-
}
486-
];
487-
}
488479
var FusionChartsModule = (function () {
489480
function FusionChartsModule() {
490481
}
482+
// Keep this method unchanged for backward compatible
491483
FusionChartsModule.forRoot = function (fusionChartsCore) {
492484
var fusionChartsModules = [];
493485
for (var _i = 1; _i < arguments.length; _i++) {
@@ -497,10 +489,23 @@ var FusionChartsModule = (function () {
497489
ngModule: FusionChartsModule,
498490
providers: [
499491
FusionChartsService,
500-
provideFusionChartsCoreService(fusionChartsCore, fusionChartsModules)
492+
{
493+
provide: FusionChartsCoreService,
494+
useValue: {
495+
core: fusionChartsCore,
496+
modules: fusionChartsModules
497+
}
498+
}
501499
]
502500
};
503501
};
502+
FusionChartsModule.fcRoot = function (fusionChartsCore) {
503+
var fusionChartsModules = [];
504+
for (var _i = 1; _i < arguments.length; _i++) {
505+
fusionChartsModules[_i - 1] = arguments[_i];
506+
}
507+
FusionChartsService.resolveFusionChartsCore(fusionChartsCore, fusionChartsModules);
508+
};
504509
return FusionChartsModule;
505510
}());
506511
FusionChartsModule.decorators = [
@@ -510,6 +515,10 @@ FusionChartsModule.decorators = [
510515
],
511516
exports: [
512517
FusionChartsComponent
518+
],
519+
providers: [
520+
FusionChartsService,
521+
FusionChartsCoreService
513522
]
514523
},] },
515524
];

dist/dist/index.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ModuleWithProviders } from '@angular/core';
2-
export declare function provideFusionChartsCoreService(fusionChartsCore: any, fusionChartsModules: Function[]): any;
32
export declare class FusionChartsModule {
43
static forRoot(fusionChartsCore: any, ...fusionChartsModules: Function[]): ModuleWithProviders;
4+
static fcRoot(fusionChartsCore: any, ...fusionChartsModules: Function[]): void;
55
}

dist/src/fusioncharts/fusioncharts.module.js

Lines changed: 19 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/fusioncharts/fusioncharts.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"__symbolic":"module","version":3,"metadata":{"provideFusionChartsCoreService":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":[{"provide":{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"},"multi":false,"useValue":{"core":{"__symbolic":"reference","name":"fusionChartsCore"},"modules":{"__symbolic":"reference","name":"fusionChartsModules"}}}]},"FusionChartsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"exports":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":{"ngModule":{"__symbolic":"reference","name":"FusionChartsModule"},"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"__symbolic":"call","expression":{"__symbolic":"reference","name":"provideFusionChartsCoreService"},"arguments":[{"__symbolic":"reference","name":"fusionChartsCore"},{"__symbolic":"reference","name":"fusionChartsModules"}]}]}}}}}},{"__symbolic":"module","version":1,"metadata":{"provideFusionChartsCoreService":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":[{"provide":{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"},"multi":false,"useValue":{"core":{"__symbolic":"reference","name":"fusionChartsCore"},"modules":{"__symbolic":"reference","name":"fusionChartsModules"}}}]},"FusionChartsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"exports":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":{"ngModule":{"__symbolic":"reference","name":"FusionChartsModule"},"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"__symbolic":"call","expression":{"__symbolic":"reference","name":"provideFusionChartsCoreService"},"arguments":[{"__symbolic":"reference","name":"fusionChartsCore"},{"__symbolic":"reference","name":"fusionChartsModules"}]}]}}}}}}]
1+
[{"__symbolic":"module","version":3,"metadata":{"FusionChartsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"exports":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":{"ngModule":{"__symbolic":"reference","name":"FusionChartsModule"},"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"provide":{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"},"useValue":{"core":{"__symbolic":"reference","name":"fusionChartsCore"},"modules":{"__symbolic":"reference","name":"fusionChartsModules"}}}]}}}}}},{"__symbolic":"module","version":1,"metadata":{"FusionChartsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"exports":[{"__symbolic":"reference","module":"./fusioncharts.component","name":"FusionChartsComponent"}],"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["fusionChartsCore","fusionChartsModules"],"value":{"ngModule":{"__symbolic":"reference","name":"FusionChartsModule"},"providers":[{"__symbolic":"reference","module":"./fusioncharts.service","name":"FusionChartsService"},{"provide":{"__symbolic":"reference","module":"./fusioncharts.core.service","name":"FusionChartsCoreService"},"useValue":{"core":{"__symbolic":"reference","name":"fusionChartsCore"},"modules":{"__symbolic":"reference","name":"fusionChartsModules"}}}]}}}}}}]
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { FusionChartsCoreService } from './fusioncharts.core.service';
22
export declare class FusionChartsService {
33
private fusionChartsCoreService;
4-
private resolvedFusionChartsCore;
4+
private static resolvedFusionChartsCore;
5+
static getResolvedFusionChartsCore(): any;
6+
static isFusionChartsCoreResolved(): boolean;
7+
static resolveFusionChartsCore(core: any, modules: any[]): void;
58
constructor(fusionChartsCoreService: FusionChartsCoreService);
6-
_resolveFusionChartsCore(): void;
7-
getResolvedFusionChartsCore(): any;
89
newFusionChartsInstance(chartConfig: any): any;
910
}

0 commit comments

Comments
 (0)