迈向 Angular 2.0 的第一步。
首先是建立合适的开发环境。
我的index.html
<!DOCTYPE HTML>
<html>
<head>
<title>Welcome to Angular 2.0</title>
<!--css-->
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
</head>
<body>
<div class="container">
<h1> Hello Angular 2 </h1>
<my-app> Loading app component....<my-app>
</div>
<!--js-->
<!-- Polyfills for older browsers -->
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>
<script src="https://unpkg.com/zone.js@0.7.4?main=browser"></script>
<script src="https://unpkg.com/reflect-metadata@0.1.8"></script>
<script src="https://unpkg.com/systemjs@0.19.39/dist/system.src.js"> </script>
<script> window.autoBootstrap = true; </script>
<script src="https://cdn.rawgit.com/angular/angular.io/b3c65a9/public/docs/_examples/_boilerplate/systemjs.config.web.js"></script>
<script>
System.import('app').catch(function (e) { console.log(e); });
</script>
<!--js-->
</body>
</html>
我已经复制了https://angular.io/docs/ts/latest/guide/setup.html的内容对于以下文件:-
- app.component.ts
- app.module.ts
- main.ts
NPM 已安装并正在运行。
但是为了获取具有应用程序运行所需依赖项的 node_modules
文件夹。
我需要运行哪些命令。
What are the commands that I need to run to set up the Angular 2 environment?
请注意,我是 NPM 新手。 谢谢。
最佳答案
你有angular-cli,这是一个很好的起点。它将根据最佳实践为您设置一切。
关于javascript - 如何设置Angular 2.0的环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41569920/