Browse Source

Revert "Revert "Flatter loader code.""

Can use Promise directly now,
previous commit loads polyfill in the.js.

This reverts commit 511324bc
Herby Vojčík 4 years ago
parent
commit
179b189839
1 changed files with 10 additions and 10 deletions
  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;
-    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();
+    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();
             });
+            amber.globals.{%= name %}._start();
         });
     });
 </script>