Angular2基础

1.Angular-cli安装配置

打包工具     测试化工具       ui相关

angular用到的,angular-cli集成了

1>.安装node.js

2>.主要命令

npm install -g @angular/cli  安装

ng --version/ng -v    查看版本

ng new demo   创建项目

ng serve --open   启动项目

ng g componenet home   创建组件

ng serve --prod --aot 该命令可以减小项目负担,加快速度

ng build --prod --aot 编译构建最终生成的东西  生成dist目录

ng test 自动测试

2.三大核心概念

Route  Module   Component

(1)组件

树形结构   单向数据流, 

angular2-dependencies-graph 工具可以显示项目结构图

(2)NgModule

将功能或相关的内容放在相同模块中,动态加载模块 

利用Router和ngModule配合实现异步模块

异步路由用的path  loadChildren

3.核心架构思想

1>DI依赖注入 

 构造器注入   construtor

 注射器  injection

2>数据绑定

4.UI库

猜你喜欢

转载自www.cnblogs.com/z-ling/p/studyhouse.html