随笔分类 -  angular 2 学习笔记

摘要:更新 : 2017-05-05 现在流行 Yarn ! 它是 facebook google 推出的东西. 算是补助 npm 做的不够好的地方. 源码依然是发布去 npm,只是下载接口换掉罢了哦. npm install -g yarn ng set --global packageManager= 阅读全文
posted @ 2017-02-02 21:13 兴杰 阅读(1755) 评论(0) 推荐(0)
摘要:refer : http://stackoverflow.com/questions/39033835/angularjs2-preload-server-configuration-before-the-application-starts ( angular initialize ) 直接上代码 阅读全文
posted @ 2017-01-30 13:55 兴杰 阅读(1406) 评论(0) 推荐(0)
摘要:更新: 2024-08-21 请看新版本:Angular 18+ 高级教程 – Component 组件 の Dynamic Component 动态组件 更新 : 2020-02-21 lazy load 的时候可以用 webpack 的 prefetch 哦 import(/* webpackP 阅读全文
posted @ 2017-01-25 14:58 兴杰 阅读(8839) 评论(0) 推荐(0)
摘要:更新 : 2019-09-01 number 和 currency pipe 当我们要出美美的数字的时候就会用到了。 什么叫美美 ? 比如十万, 100000 or 100,000 哪个好一点 ? 后的丫,有逗号隔开了密密的 0 这时候就要使用 | number 了 最常用的是 | number: 阅读全文
posted @ 2016-12-25 09:49 兴杰 阅读(349) 评论(0) 推荐(0)
摘要:更新: 2020-05-13 有些冷门的事件, 是没有在 ngZone 的范围的. 比如 ResizeObserver https://dev.to/christiankohler/how-to-use-resizeobserver-with-angular-9l5 所以要在触发后跑的话,就可以写 阅读全文
posted @ 2016-10-15 12:55 兴杰
摘要:更新 2018-03-24 ng 是不允许循环依赖的 A 服务依赖 B 服务, b 服务又依赖 A 服务. 这样是不行的. 如果你非要不可, 可以使用 Injector + settimeout 来处理 (不推荐) 通过延迟注入, 打破循环. refer : http://blog.thoughtr 阅读全文
posted @ 2016-09-24 01:12 兴杰
摘要:更新: 08-04-2023 看移步修订版: RxJS 系列 – 目录 更新: 2020-11-01 zip 和 combineLatest 的区别于用法 combineLatest([ a, a ]) 当 a next 的时候会触发 2 次, 第一次拿到的 value, 一个是新值, 一个是旧值 阅读全文
posted @ 2016-09-23 17:46 兴杰 阅读(32982) 评论(0) 推荐(2)
摘要:更新 : 2021-02-13 auto refresh when save https://dev.to/juxant/auto-refresh-with-dotnet-watch-for-asp-net-core-projects-20no option > Project and Soluti 阅读全文
posted @ 2016-09-13 18:37 兴杰 阅读(902) 评论(0) 推荐(0)
摘要:更新 : 2024-08-21 请看新版本:Angular 18+ 高级教程 – Reactive Forms 更新: 2021-01-14 之前有写过 formControl 的监听与广播, 很久一下了. 而且之前写的有点乱, 最近有用到 记入多一次 我们可以直接看源码 input 是怎样监听的 阅读全文
posted @ 2016-08-30 14:45 兴杰 阅读(24234) 评论(2) 推荐(1)
摘要:更新: 2020-11-06 当 ngFor 里面有 ng-template-outlet 然后你要 queryList 就会翻车 <div *ngFor="let group of groupList"> {{ group.label }} <ng-container [ngTemplateOut 阅读全文
posted @ 2016-08-28 23:30 兴杰 阅读(30987) 评论(0) 推荐(2)
摘要:更新 : 2024-08-21 请看新版本:Angular 18+ 高级教程 – HttpClient 更新 : 2017-06-08 总觉得 angular 的 http 怎么就多了 Request, Headers, Response 这些麻烦东东呢. 原来这些都是游览器的“新特性” Fetch 阅读全文
posted @ 2016-08-28 12:16 兴杰 阅读(34014) 评论(0) 推荐(1)
摘要:更新 : 2024-08-21 请看新版本: Angular 18+ 高级教程 – Routing 路由 (原理篇) 更新 : 2019-11-21 我们经常喜欢用 empty string 来做 default router path 比如 2 个 tabs <nav mat-tab-nav-ba 阅读全文
posted @ 2016-08-26 16:50 兴杰 阅读(59816) 评论(4) 推荐(1)
摘要:2016-08-25, 当前版本是 RC 5. 参考 : https://angular.cn/docs/ts/latest/guide/ngmodule.html 提醒 : 这系列笔记的 "ng" 指的是 angular2 哦! ECMA 6 中, 每一个 .js 文件都是一个模块. ng 中的模 阅读全文
posted @ 2016-08-25 16:32 兴杰 阅读(1837) 评论(0) 推荐(0)