mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[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.
This commit is contained in:
parent
b55c6b8bce
commit
de409fd8e7
13
index.html
13
index.html
@ -4,21 +4,12 @@
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<script type="text/javascript"
|
||||
src="platform/framework/lib/require.js">
|
||||
src="platform/framework/lib/require.js"
|
||||
data-main="platform/framework/src/Main.js">
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- This is a placeholder for validating initial project structure -->
|
||||
<script type="text/javascript">
|
||||
require(
|
||||
["platform/framework/src/Temporary"],
|
||||
function (Temporary) {
|
||||
"use strict";
|
||||
document.writeln(new Temporary().someMethod());
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
31
platform/framework/src/Main.js
Normal file
31
platform/framework/src/Main.js
Normal file
@ -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);
|
||||
});
|
||||
}]);
|
||||
}
|
||||
);
|
Loading…
Reference in New Issue
Block a user