0
我想从本地PC上的WAMP运行Angular2应用程序。
我开发的应用从WAMP/WWW文件夹,并在不同阶段测试它无论从localhost:3000
和localhost/myapp
(liteserver和WAMP)在本地WAMP服务器上出现Angular2错误
一切工作正常,直到我尝试正下方的<head>
添加<base href="/">
变成index.html。
在这一点上,只有在WAMP我得到的错误:ReferenceError: System is not defined
有任何解决方法或修复闯过这个错误? (并转移到下一个:))
这是我的Index.html。
<html>
<head>
<base href="/">
<title>Firebase</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>
更新:
LiteServer工作,文件夹结构,并main.ts:
试试这个:document.write(' '); –
你可以发布你的目录结构吗? – kemsky
您是否可以检查您的浏览器控制台是否已加载并包含System.js? –