Skip to content

Commit

Permalink
Support commonJS and browserify. Cleanup of #572 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pablojim committed Mar 26, 2017
1 parent 508df11 commit 3612166
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dist/highcharts-ng.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex

if (window && window.Highcharts) {
Highcharts = window.Highcharts;
}
if (module && module.exports === 'highcharts-ng') {
} else if (module && module.exports === 'highcharts-ng') {
Highcharts = require('highcharts');
}

Expand Down
2 changes: 1 addition & 1 deletion dist/highcharts-ng.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example/charts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ myapp.controller('myctrl', function ($scope) {
$scope.chartConfig = {

chart: {
height: 500,
width: 500,
type: 'line'
},
plotOptions: {
Expand Down
2 changes: 2 additions & 0 deletions example/charts/general-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<html>
<head>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="../../src/highcharts-ng.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.src.js"></script>
<script src="../../src/highcharts-ng.js"></script>

<script src="app.js"></script>
</head>
<body>
Expand Down
2 changes: 2 additions & 0 deletions example/charts/highstocks-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ myapp.controller('myctrl', function ($scope) {
text: 'Click and drag to zoom in.'
},
chart: {
height: 500,
width: 500,
backgroundColor: 'transparent',
zoomType: 'xy',
resetZoomButton: {
Expand Down
3 changes: 1 addition & 2 deletions src/highcharts-ng.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex

if (window && window.Highcharts) {
Highcharts = window.Highcharts;
}
if (module && module.exports === 'highcharts-ng') {
} else if (module && module.exports === 'highcharts-ng') {
Highcharts = require('highcharts');
}

Expand Down

0 comments on commit 3612166

Please sign in to comment.