浏览代码

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 年之前
父节点
当前提交
179b189839
共有 1 个文件被更改,包括 10 次插入10 次删除
  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>