From fbaa1968b7c596ccb63ea8b4be1d3bd92eda50d8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 9 Apr 2012 14:27:14 -0700 Subject: chore($browser): remove the addJs method this was never meant to be a public api used by apps. I refactored the code to hide the functionality. BREAKING CHANGE: $browser.addJs method was removed apps that depended on this functionality should either use many of the existing script loaders or create a simple helper method specific to the app. --- src/ng/browser.js | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/ng/browser.js') diff --git a/src/ng/browser.js b/src/ng/browser.js index 376c3fd4..465114c5 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -343,39 +343,6 @@ function Browser(window, document, body, $log, $sniffer) { // Misc API ////////////////////////////////////////////////////////////// - - /** - * @ngdoc method - * @name angular.module.ng.$browser#addJs - * @methodOf angular.module.ng.$browser - * - * @param {string} url Url to js file - * - * @description - * Adds a script tag to the head. - */ - self.addJs = function(url, done) { - // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.: - // - fetches local scripts via XHR and evals them - // - adds and immediately removes script elements from the document - var script = rawDocument.createElement('script'); - - script.type = 'text/javascript'; - script.src = url; - - if (msie) { - script.onreadystatechange = function() { - /loaded|complete/.test(script.readyState) && done && done(); - }; - } else { - if (done) script.onload = script.onerror = done; - } - - body[0].appendChild(script); - - return script; - }; - /** * Returns current * (always relative - without domain) -- cgit v1.2.3