1
0
Kaynağa Gözat

Revert "Flatter loader code."

Cannot use Promise directly if not native in browser, eg. IE11.

This reverts commit 8a49deb6
Herby Vojčík 4 yıl önce
ebeveyn
işleme
511324bc05
1 değiştirilmiş dosya ile 10 ekleme ve 10 silme
  1. 10 10
      grunt-init-project/root/index.html

+ 10 - 10
grunt-init-project/root/index.html

@@ -25,17 +25,17 @@
 <!-- EXAMPLE APP END -->
 <script type='text/javascript'>
     var global = typeof global === "undefined" ? window : global || window;
-    new Promise(function (resolve, reject) {
-        require(['app'], resolve, reject);
-    }).then(function (amber) {
-        return amber.initialize({
-            //used for all new packages in IDE
-            'transport.defaultAmdNamespace': "{%= namespace %}"
-        }).then(function () {
-            require(["amber-ide-starter-dialog"], function (dlg) {
-                dlg.start();
+    require(['app'], function (amberPromise) {
+        amberPromise.then(function (amber) {
+            amber.initialize({
+                //used for all new packages in IDE
+                'transport.defaultAmdNamespace': "{%= namespace %}"
+            }).then(function () {
+                require(["amber-ide-starter-dialog"], function (dlg) {
+                    dlg.start();
+                });
+                amber.globals.{%= name %}._start();
             });
-            amber.globals.{%= name %}._start();
         });
     });
 </script>