Angular2+项目初尝试
Angular2+项目搭建
安装Angular CLI
安装全局cli脚手架:npm install -g @angular/cli

创建项目
ng new <project-name>, 其中:<project-name>是Angular项目名称
如:ng new my-app

定位到项目目录进行后续操作
cd my-app
启动项目
ng serve --open //启动服务,自动打开浏览器

浏览器运行后:

常用的创建命令:ng generate <schematic> [options]
class 类
component 组件
directive 指令
enum 枚举
interface 接口
module ngModel
pipe 管道//管道格式化数据
service 服务

浙公网安备 33010602011771号