2016-11-07 7 views
0
definiert

ich diese Störung erhalte, wenn angular2 Seite zu laden versuchen:(SystemJS) Modul ist nicht

https://postimg.org/image/meg0l2znn/

Meine index.html

<!DOCTYPE html> 
<html> 
<head> 
    <title>Reloyalty Administration Dashboard</title> 

    <!-- Viewport mobile tag for sensible mobile support --> 
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
    <link rel="icon" href="/favicon.ico"> 

    <!-- For Angular2 Routing --> 
    <base href="/"> 


    <!-- Common Scripts--> 
    <script src="/common/js/jquery-1.11.3.min.js"></script> 

    <!--SCRIPTS--> 
    <script src="/bootstrap/js/bootstrap.min.js"></script> 
    <script src="/dashboard/js/bootstrap-switch.js"></script> 
    <script src="/dashboard/js/calendar-conf-events.js"></script> 
    <script src="/dashboard/js/chartjs-conf.js"></script> 
    <script src="/dashboard/js/common-scripts.js"></script> 
    <script src="/dashboard/js/easy-pie-chart.js"></script> 
    <script src="/dashboard/js/form-component.js"></script> 
    <script src="/dashboard/js/gritter-conf.js"></script> 
    <script src="/dashboard/js/jquery-ui-1.9.2.custom.min.js"></script> 
    <script src="/dashboard/js/jquery.backstretch.min.js"></script> 
    <script src="/dashboard/js/jquery.dcjqaccordion.2.7.js"></script> 
    <script src="/dashboard/js/jquery.nicescroll.js"></script> 
    <script src="/dashboard/js/jquery.scrollTo.min.js"></script> 
    <script src="/dashboard/js/jquery.sparkline.js"></script> 
    <script src="/dashboard/js/jquery.tagsinput.js"></script> 
    <script src="/dashboard/js/jquery.ui.touch-punch.min.js"></script> 
    <script src="/dashboard/js/sparkline-chart.js"></script> 
    <script src="/dashboard/js/tasks.js"></script> 
    <script src="/dashboard/js/zabuto_calendar.js"></script> 
    <script src="/dashboard/js/bootstrap-inputmask/bootstrap-inputmask.min.js"></script> 
    <script src="/dashboard/js/chart-master/Chart.js"></script> 
    <script src="/dashboard/js/fancybox/jquery.fancybox.js"></script> 
    <script src="/dashboard/js/fullcalendar/fullcalendar.min.js"></script> 
    <script src="/dashboard/js/gritter/js/jquery.gritter.js"></script> 
    <script src="/dashboard/js/jquery-easy-pie-chart/jquery.easy-pie-chart.js"></script> 
    <script src="/js/node_modules/es6-shim/es6-shim.min.js"></script> 
    <script src="/js/node_modules/reflect-metadata/Reflect.js"></script> 
    <script src="/js/node_modules/systemjs/dist/system-polyfills.js"></script> 
    <script src="/js/node_modules/systemjs/dist/system.src.js"></script> 
    <script src="/js/node_modules/zone.js/dist/zone.js"></script> 
    <script src="/js/node_modules/rxjs/bundles/Rx.js"></script> 
    <!--SCRIPTS END--> 

    <script> 



     System.config({ 
      packages: { 
       app: { 
        format: 'register', 
        defaultExtension: 'js', 
        main: './main.js' 
       }, 
       '@angular/core': { 
        main: 'bundles/core.umd.js', 
        defaultExtension: 'js' 
       }, 
       '@angular/compiler': { 
        main: 'bundles/compiler.umd.js', 
        defaultExtension: 'js' 
       }, 
       '@angular/common': { 
        main: 'bundles/common.umd.js', 
        defaultExtension: 'js' 
       }, 
       '@angular/platform-browser-dynamic': { 
        main: 'bundles/platform-browser-dynamic.umd.js', 
        defaultExtension: 'js' 
       }, 
       '@angular/platform-browser': { 
        main: 'bundles/platform-browser.umd.js', 
        defaultExtension: 'js' 
       }, 
       rxjs: { 
        main: 'bundles/Rx.umd.min.js', 
        defaultExtension: 'js' 
       } 
      }, 
      map: { 
       'app': 'management', // where my app is. '.' means relative 
       '@angular': '/js/node_modules/@angular', 
       'rxjs': '/js/node_modules/rxjs' 
      } 
     }); 
     System.import('app') 
       .then(null, console.error.bind(console)); 
    </script> 

    <!-- end AngularJS 2--> 
</head> 

<body> 

<root-component>Loading...</root-component> 

</body> 
</html> 

Was ist los? Warum ist es nicht SystemJS finden ...

HINWEIS: Meine Ordnerstruktur ist, dass die App unter assets/Management-Ordner wie so befindet:

management/ 
├── app/ 
| ├──root/ 
│  ├── root.component.ts 
|  ├── root.module.ts 
├──main.ts 

NOTE2: Entfernen System.import ... Ergebnisse in dem Fehler nicht

System.import('app') 
       .then(null, console.error.bind(console)); 

Antwort

0

ich wette, Sie system.src.js und dann system-polyfills.js müssen zunächst Last geworfen. Du machst es jetzt anders herum.

<script src="/js/node_modules/systemjs/dist/system.src.js"></script> 
<script src="/js/node_modules/systemjs/dist/system-polyfills.js"></script> 

See: https://github.com/systemjs/systemjs#promise-polyfill

Verwandte Themen