From 86aa0fe8280eb2822f761d5cfa0190a49ad2c3df Mon Sep 17 00:00:00 2001 From: "jesus.abarca" Date: Mon, 21 Sep 2015 00:29:18 -0500 Subject: [PATCH] fix(loader): replace remove() with removeChild() to delete an existing script tag --- src/coffee/providers/map-loader.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coffee/providers/map-loader.coffee b/src/coffee/providers/map-loader.coffee index f0db7e376..11c5fab4e 100644 --- a/src/coffee/providers/map-loader.coffee +++ b/src/coffee/providers/map-loader.coffee @@ -23,7 +23,10 @@ angular.module('uiGmapgoogle-maps.providers') query = _.map _.omit(options, omitOptions), (v, k) -> k + '=' + v - document.getElementById(scriptId).remove() if scriptId + if scriptId + scriptElem = document.getElementById(scriptId) + scriptElem.parentNode.removeChild(scriptElem) + query = query.join '&' script = document.createElement 'script' script.id = scriptId = "ui_gmap_map_load_#{uuid.generate()}"