From de409fd8e75e0e9a66f5c91ae5429190defe49a8 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 31 Oct 2014 16:43:16 -0700 Subject: [PATCH] [Framework] Begin work on main point-of-entry Add main point-of-entry script for framework layer; performs only minimal tasks of loading framework dependencies and demonstrating that bundle list can be loaded using these. WTD-518. --- index.html | 13 ++----------- platform/framework/src/Main.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 platform/framework/src/Main.js diff --git a/index.html b/index.html index 83258e75ce..04f88d2551 100644 --- a/index.html +++ b/index.html @@ -4,21 +4,12 @@ - - \ No newline at end of file diff --git a/platform/framework/src/Main.js b/platform/framework/src/Main.js new file mode 100644 index 0000000000..c914184329 --- /dev/null +++ b/platform/framework/src/Main.js @@ -0,0 +1,31 @@ +/*global define, requirejs*/ + +requirejs.config({ + "shim": { + "../lib/angular.min": { + "exports": "angular" + } + } +}); + +define( + [ + 'require', + '../lib/es6-promise-2.0.0.min', + '../lib/angular.min' + ], + function (require, es6promise, angular) { + "use strict"; + + var injector = angular.injector(['ng']); + + // Polyfill Promise, in case browser does not natively provide Promise + window.Promise = window.Promise || es6promise.Promise; + + injector.invoke(['$http', function ($http) { + return $http.get('bundles.json').then(function (b) { + console.log(b); + }); + }]); + } +); \ No newline at end of file