javascript - Define is not a function using SystemJS -


i'm using systemjs module system in angular 2. index.html file

<html>    <head>     <base href="/">     <meta http-equiv="content-type" content="text/html; charset=utf-8">     <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />     <title>home</title>      <link rel="stylesheet" href="//js.arcgis.com/3.15/esri/css/esri.css">      <!-- ie required polyfills, in exact order -->     <script src="es6-shim/es6-shim.min.js"></script>     <script src="systemjs/dist/system-polyfills.js"></script>      <script src="angular2/bundles/angular2-polyfills.js"></script>     <script src="systemjs/dist/system.src.js"></script>     <script src="rxjs/bundles/rx.js"></script>     <script src="angular2/bundles/angular2.dev.js"></script>     <!-- routing -->     <script src="angular2/bundles/router.dev.js"></script>      <!-- arcgis -->     <script src="//js.arcgis.com/3.15/"></script>     <script>       system.config({         defaultjsextensions: true,         map: {           esri: '//js.arcgis.com/3.15/esri'         },         packages: {           app: {             format: 'register',             defaultextension: 'js'           }         }       });        system.import('app/main')         .then(null, console.error.bind(console));     </script>    </head>    <body>     <app>loading map...</app>   </body>  </html> 

unfortunately following error:

enter image description here

this error come because i'm using systemjs instead of amd , define not recognized properly. have suggestion?

edit:

added following configuration:

<script>       system.config({         defaultjsextensions: true,         packages: {           app: {             format: 'register',             defaultextension: 'js',             map: {               esri: '//js.arcgis.com/3.15/esri'             },             meta: {               'esri/*': {                 format: 'amd'               }             }           }         }       });        system.import('app/main')         .then(null, console.error.bind(console));     </script> 

but still getting same error

define function used in other amd managements tools such requirejs.

it may code trying load via systemjs geared load using requirejs or similar library.


Comments

Popular posts from this blog

python - cx_oracle unable to find Oracle Client -

shader - OpenGL Shadow Map -

c# - Exchange 2010/2013 TransportAgent Content Conversion for Internal Recipients -