Skip to content

Commit 07cfa61

Browse files
authored
Merge pull request #15 from fusioncharts/feature/restructure-and-issue-fix
Feature/restructure and issue fix
2 parents cb30d00 + d228901 commit 07cfa61

Some content is hidden

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

79 files changed

+7682
-280
lines changed

.angular-cli.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "ng2-fc"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "gh-pages",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "app",
21+
"styles": [
22+
"styles.css"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json"
40+
},
41+
{
42+
"project": "src/tsconfig.spec.json"
43+
},
44+
{
45+
"project": "e2e/tsconfig.e2e.json"
46+
}
47+
],
48+
"test": {
49+
"karma": {
50+
"config": "./karma.conf.js"
51+
}
52+
},
53+
"defaults": {
54+
"styleExt": "css",
55+
"component": {}
56+
}
57+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
1-
# Node
2-
node_modules/*
3-
npm-debug.log
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
47

5-
# TypeScript
6-
*.d.ts
8+
# dependencies
9+
/node_modules
710

8-
# JetBrains
9-
.idea
11+
# IDEs and editors
12+
/.idea
1013
.project
11-
.settings
12-
.idea/*
13-
*.iml
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
1419

15-
# VS Code
20+
# IDE - VSCode
1621
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
1726

18-
# Windows
19-
Thumbs.db
20-
Desktop.ini
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
2139

22-
# Mac
40+
# System Files
2341
.DS_Store
24-
**/.DS_Store
42+
Thumbs.db
2543

26-
aot/
44+
# Docs generated directory
45+
gh-pages/

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ Desktop.ini
2626
.DS_Store
2727
**/.DS_Store
2828

29+
# Source files
30+
src/
2931
aot/
32+
33+
# Docs generated directory
34+
gh-pages/

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ exports.FusionChartsDirective = fusioncharts_directive_1.FusionChartsDirective;
1414
var fusioncharts_pipe_1 = require("./src/fusioncharts.pipe");
1515
exports.FusionChartsPipe = fusioncharts_pipe_1.FusionChartsPipe;
1616
var fusioncharts_service_1 = require("./src/fusioncharts.service");
17+
exports.FusionChartsStatic = fusioncharts_service_1.FusionChartsStatic;
1718
var FusionChartsModule = FusionChartsModule_1 = (function () {
1819
function FusionChartsModule() {
1920
}

dist/src/fusioncharts.component.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ var core_1 = require("@angular/core");
1313
var fusioncharts_service_1 = require("./fusioncharts.service");
1414
var fusioncharts_constructor_1 = require("./fusioncharts.constructor");
1515
var FusionChartsComponent = (function () {
16-
function FusionChartsComponent(element, fusionchartsService, differs) {
16+
function FusionChartsComponent(element, fusionchartsService, differs, zone) {
1717
this.differs = differs;
18+
this.zone = zone;
1819
this.oldDataSource = this.dataSource;
1920
this.constructerParams = {
2021
type: true,
@@ -127,9 +128,8 @@ var FusionChartsComponent = (function () {
127128
}
128129
};
129130
FusionChartsComponent.prototype.ngAfterViewInit = function () {
130-
var _this = this,
131-
// element = _this.element.nativeElement,
132-
_chartConfig = _this.chartConfig || {}, params = _this.constructerParams, configObj = _this.configObj || (_this.configObj = {});
131+
var _this = this, params = _this.constructerParams, configObj = _this.configObj || (_this.configObj = {});
132+
var _chartConfig = _this.chartConfig || {};
133133
if (typeof _chartConfig === 'string') {
134134
_chartConfig = JSON.parse(_chartConfig);
135135
}
@@ -142,11 +142,11 @@ var FusionChartsComponent = (function () {
142142
}
143143
if (configObj['type']) {
144144
_this.chartObj = fusioncharts_constructor_1.FusionChartsConstructor(_this.fusionchartsService, configObj);
145-
configObj['renderAt'] = 'container-' + _this.chartObj.id;
146-
_this.containerId = _this.chartObj.id;
145+
// configObj['renderAt'] = 'container-' + _this.chartObj.id;
146+
// _this.containerId = _this.chartObj.id;
147147
this.zone.runOutsideAngular(function () {
148148
setTimeout(function () {
149-
_this.chartObj.render(_this.configObj['renderAt']);
149+
_this.chartObj.render(_this.element.nativeElement.querySelector('div'));
150150
}, 1);
151151
});
152152
}
@@ -394,7 +394,6 @@ FusionChartsComponent = __decorate([
394394
template: "<div attr.id=\"container-{{containerId}}\" >{{placeholder}}</div>\n ",
395395
providers: [fusioncharts_service_1.FusionChartsService],
396396
}),
397-
__metadata("design:paramtypes", [typeof (_a = typeof core_1.ElementRef !== "undefined" && core_1.ElementRef) === "function" && _a || Object, fusioncharts_service_1.FusionChartsService, typeof (_b = typeof core_1.KeyValueDiffers !== "undefined" && core_1.KeyValueDiffers) === "function" && _b || Object])
397+
__metadata("design:paramtypes", [core_1.ElementRef, fusioncharts_service_1.FusionChartsService, core_1.KeyValueDiffers, core_1.NgZone])
398398
], FusionChartsComponent);
399399
exports.FusionChartsComponent = FusionChartsComponent;
400-
var _a, _b;

dist/src/fusioncharts.directive.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ var FusionChartsDirective = (function () {
1818
}());
1919
FusionChartsDirective = __decorate([
2020
core_1.Directive({
21-
selector: '[fusionchartsDirective]'
21+
selector: '[appFusionchartsDirective]'
2222
}),
23-
__metadata("design:paramtypes", [typeof (_a = typeof core_1.ElementRef !== "undefined" && core_1.ElementRef) === "function" && _a || Object])
23+
__metadata("design:paramtypes", [core_1.ElementRef])
2424
], FusionChartsDirective);
2525
exports.FusionChartsDirective = FusionChartsDirective;
26-
var _a;

dist/src/fusioncharts.service.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ FusionChartsStatic = __decorate([
2121
exports.FusionChartsStatic = FusionChartsStatic;
2222
var FusionChartsService = (function () {
2323
function FusionChartsService(FusionChartsStatic) {
24-
this._fusionchartsStatice = FusionChartsStatic.core;
25-
FusionChartsStatic.modules && FusionChartsStatic.modules.forEach(function (FusionChartsModules) {
26-
FusionChartsModules(FusionChartsStatic.core);
27-
});
24+
/* TODO: Need to remove this when FusionCharts becomes ES6 modules */
25+
this._fusionchartsStatice = FusionChartsStatic.core || FusionCharts;
26+
if (FusionChartsStatic && FusionChartsStatic.modules) {
27+
FusionChartsStatic.modules.forEach(function (FusionChartsModules) {
28+
FusionChartsModules(FusionChartsStatic.core);
29+
});
30+
}
2831
}
2932
FusionChartsService.prototype.getFusionChartsStatic = function () {
3033
return this._fusionchartsStatice;

e2e/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Ng2FcPage } from './app.po';
2+
3+
describe('ng2-fc App', () => {
4+
let page: Ng2FcPage;
5+
6+
beforeEach(() => {
7+
page = new Ng2FcPage();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('app works!');
13+
});
14+
});

e2e/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, element, by } from 'protractor';
2+
3+
export class Ng2FcPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

0 commit comments

Comments
 (0)