From 324fed9b3c56e0cec7e6fa150fb779355eb3c47f Mon Sep 17 00:00:00 2001 From: Rolf Sommerhalder Date: Sun, 27 Apr 2014 07:29:42 +0200 Subject: [PATCH] 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 . --- dist/planetaryjs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/planetaryjs.js b/dist/planetaryjs.js index 86d7aea..a8ccbf1 100644 --- a/dist/planetaryjs.js +++ b/dist/planetaryjs.js @@ -6,7 +6,9 @@ */ (function (root, factory) { 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') { module.exports = factory(require('d3'), require('topojson')); } else {