加载依赖项时启动角度错误:

时间:2018-12-29 09:44:41

标签: angular

我正在开发角度为6的应用程序。昨天一切正常,但是今天我无法启动它。

enter image description here

所以我从unpkg加载依赖项。

我不使用cli,所以这是我的文件

index.html

<!DOCTYPE html>
<html>
  <head>
    <base href="/">
    <title>Memoreasy</title>
    <base href="/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <!-- Polyfill(s) for older browsers -->
    <script src="https://unpkg.com/core-js/client/shim.min.js"></script>
    <script src="https://unpkg.com/zone.js@0.8.4?main=browers"></script>
    <script src="https://unpkg.com/systemjs@0.19.40/dist/system.src.js"></script>
    <!-- <script src="https://unpkg.com/core-js@^2.4.1/client/shim.min.js"></script>
    <script src="https://unpkg.com/zone.js@^0.8.4/dist/zone.min.js"></script>
    <script src="https://unpkg.com/systemjs@0.19.40/dist/system.src.js"></script> -->

    <script src="/systemjs.config.server.js"></script>
    <script>
      System.import('dist/main.js').catch(function(err){ console.error(err); });
    </script>
  </head>

  <body>
    <pokemon-app>
      <br>
      <br>
      <div class="center">
        Chargement...  
      </div>
      <br>
      <div class="row">
          <div class="col s4 offset-s4">
            <div class="progress">
            <div class="indeterminate"></div>
          </div>
        </div>
      </div>    
    </pokemon-app>
  </body>
</html>

systemjs.config.server.js

/**
* Version de SystemJS dédié à la production.
* Les paquets sont chargés depuis le web.
*/
(function (global) {
System.config({
paths: {
'npm:': 'https://unpkg.com/' // Le nouvel alias
},

map: {
app: 'dist',
'@angular/core': 'npm:@angular/core@5.0.0/bundles/core.umd.min.js',
'@angular/common': 'npm:@angular/common@5.0.0/bundles/common.umd.min.js',
'@angular/compiler': 'npm:@angular/compiler@5.0.0/bundles/compiler.umd.min.js',
'@angular/platform-browser': 'npm:@angular/platform-browser@5.0.0/bundles/platform-browser.umd.min.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@5.0.0/bundles/platform-browser-dynamic.umd.min.js',
'@angular/http': 'npm:@angular/http@5.0.0/bundles/http.umd.min.js',
'@angular/common/http': 'npm:@angular/common@5.0.0/bundles/common-http.umd.min.js',
'@angular/router': 'npm:@angular/router@5.0.0/bundles/router.umd.min.js',
'@angular/forms': 'npm:@angular/forms@5.0.0/bundles/forms.umd.min.js',
'rxjs': 'npm:rxjs@5.5.3',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api@0.5.2/bundles/in-memory-web-api.umd.js',
'tslib': 'npm:tslib/tslib.js'
},
packages: {
app: {
    main: './main.js',
    defaultExtension: 'js'
},
rxjs: {
    main: 'index.js',
    defaultExtension: 'js'
    }
    }
});
})(this);

昨天一切都很好,所以我的网络可能会出错吗?

先谢谢您

0 个答案:

没有答案