ng-planetaryjs looks for global with AMD loader
While using RequireJS to AMD load ng-planetaryjs, planetaryjs, and their dependencies, ng-planetaryjs still looks for global object planetaryjs (such as in ```var globe = planetaryjs.planet();```). Thus use the UMD pattern "AMD with global, Node, or global" instead of "AMD, Node, or browser global" from https://sublime.wbond.net/packages/UMD%20snippets .
This commit is contained in:
parent
c86479db1f
commit
324fed9b3c
4
dist/planetaryjs.js
vendored
4
dist/planetaryjs.js
vendored
@ -6,7 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
define(['d3', 'topojson'], factory);
|
define(['d3', 'topojson'], function(d3, topojson) {
|
||||||
|
return (root.planetaryjs = factory(d3, topojson));
|
||||||
|
});
|
||||||
} else if (typeof exports === 'object') {
|
} else if (typeof exports === 'object') {
|
||||||
module.exports = factory(require('d3'), require('topojson'));
|
module.exports = factory(require('d3'), require('topojson'));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user