ng-book 2 r60 (Angular 4) 简介
来源:互联网 发布:单片机助手 编辑:程序博客网 时间:2024/06/06 06:46
Based on ng-book 2 r60 version, personal notes
基于 Angular 权威教程 r60版本 , 个人笔记
- Angular CLI
- start a new project
- 默认端口
- 新建组件
- 更新
- Angular版本
- Overall
Angular CLI
不是必须,只是一个快速构建工具
not a requirement, simply a wrapper around Webpack.
install npm install -g @angular/cli
usage ng -help
start a new project
ng new XXcd xxng service
默认端口
http://localhost:4200/
configure host ng serve --host 0.0.0.0 --port 4201
新建组件
ng generate
or ng g
ng g component my-new-component
Directive ng g directive my-new-directive
Pipe ng g pipe my-new-pipe
Service ng g service my-new-service
Class ng g class my-new-class
Guard ng g guard my-new-guard
Interface ng g interface my-new-interface
Enum ng g enum my-new-enum
Module ng g module my-module
angular-cli will add reference to components
, directives
and pipes
automatically in the app.module.ts
. If you need to add this references to another custom module, follow this steps:
ng g module new-module
to create a new module- call
ng g component new-module/new-component
This should add the new component
, directive
or pipe
reference to the new-module
you’ve created.
更新
同时需要global and local
Global package:
npm uninstall -g @angular/clinpm cache cleannpm install -g @angular/cli@latest
Local project package:
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShellnpm install --save-dev @angular/cli@latestnpm install
Angular版本
最早是叫AngularJS, 官方声明中,AngularJS指的是Angjular 1.x 版本。 后面的版本 Angular用了TypeScript替代JavaScript, 后缀JS去掉了,也被称为 Angular 2。
在2017年,Anjular团队用语义版本名称,也就是不再叫做Anjular X, 而只是Anjular。 没有数字。目前(2017)最新版本俗称Angjular 4。
Anjular 的JS版本也就是1.x版本,被指定为AnjularJS。后续版本目前(2017)就叫做Anjular。两个版本是两个不同的项目。
Overall
本书可以分为几个部分:
基础部分,创建第一个app, 使用内置组件并且学会创建组件。
中间部分,使用表格,APIs, 路由, 和依赖注入(Dependency Injection)
进阶部分,数据结构,管理client和server的state,两种方法:RxJS Observables 和Redux。
最终部分,学习写出复杂的组件,写出tests,如何从Anjular 1.x 升级到Anjular 4.0+,学习使用NativeScript写出原生移动apps
本书目的:学习如何打造一个实战Anjular项目,节省了在不同博客,教程之间查阅时间。
- ng-book 2 r60 (Angular 4) 简介
- Angular CLI简介2
- 细说Angular ng-class
- angular--ng-options
- 细说Angular ng-class
- angular的ng-options
- 细说Angular ng-class
- angular ng-options
- 细说Angular ng-class
- angular checkbox ng-model
- Angular ng 学习
- 细说Angular ng-class
- Angular—ng-class
- angular ng-disabled
- angular ng-repeat嵌套
- angular指令ng-xxx
- 细说Angular ng-class
- angular ng-options使用
- Matrix Chain Multiplication
- 如何快速定位自己热爱的工作
- Mongdb和mysql的一些比较
- 49.字符串分类
- 递归方法计算一个中缀表达式的值
- ng-book 2 r60 (Angular 4) 简介
- 第四章 一个失去部队的将军 还不如一个回作战的小兵
- TCP协议详解(慢启动,流量控制,阻塞控制之类)
- HTML5_canvas
- 二分大法示例-cf的Enduring Exodus
- Javascript实现选项卡功能
- 类模板实现数组排序
- 1、zookeeper简介
- 深入理解计算机操作系统(2.1.8 2.1.9)