安装运行angular2
如果您发现本文排版有问题,可以先点击下面的链接切换至老版进行查看!!!
安装运行angular2
首先我们得安装nodejs(版本在6.x以上),它里面已经自带了npm。安装官方的介绍运行npm install之后,我们还要在项目中安装rxjs,
npm install rxjs
没有正常安装的时候运行npm start或者http-server运行服务器,打开http://127.0.0.1:8080/只会看见页面上出现 loading,这是因为index.html里面有如下代码:
<body>
<my-app>Loading...</my-app>
</body>
未能正常加载组件app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
})
export class AppComponent { }
出现的错误一般是
Failed to load resource: the server responded with a status of 404 (Not Found) angular2-polyfills.js:332 Error: Error: XHR error (404 Not Found) loading http://127.0.0.1:8080/rxjs....正常运行才会出现下面的界面

- 分类:
- Web前端
更新时间:
相关文章
前端也会需要一个消费队列
现在我们已经习惯了模块化,微服务化,这样的确带来了很多的好处,但是有时也会有些小麻烦。比如: A组件和B组件各要调用一个接口,并且根据接口调用完成后执行回调,要求A组件的回调较B组件的先执行。 如果 阅读更多…