首页
AI Coding
NEW
沸点
课程
直播
活动
AI刷题
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
会员
登录
注册
Angular 学习之路
已注销
创建于2022-03-01
订阅专栏
我的 Angular 学习笔记
等 18 人订阅
共226篇文章
创建于2022-03-01
订阅专栏
默认顺序
默认顺序
最早发布
最新发布
使用Async对Angular异步代码进行单元测试
https://www.digitalocean.The async utility tells Angular to run the code in a dedicated test zone that intercepts promises.async可以让Angular在一...
Angular里setTimeout和change detection的关系
Causes Angular to run change detection for the whole application, like ApplicationRef.tick zone.js patches async APIs (addEventHandler, setT...
Angular单元测试fixture.detectChanges()
https://codecraft.// create component and test fixture fixture = TestBed.fixture通过ATB的createComponent方法创建,输入参数是正式的Component.The fixture as w...
Angular ActivatedRouteSnapshot
研究方法:在routing-params.service.
Angular ctorParameters,decorator等元数据,包含在ActivatedRouteSnapshot数据结构里
顾名思义,这个变量包含了一个Angular Component构造函数的参数。templateUrl: './page-layout.component.changeDetection: ChangeDetectionStrategy.
想调试Angular框架的@HostBinding,应该在哪里设置断点
在core.进入fesm2015/router.RouterLinkWithHref.ɵdir = ɵngcc0.ɵngcc0.ɵɵlistener("click", function RouterLinkWithHref_click_HostBindingHandler($ev...
Angular元素属性绑定的一个例子
如下图的例子:a标签的disabled class绑定到model.active属性的取反值,即如果model.active为false,该标签就为disabled状态。准备更新class.
调试Angular指令实现时一个有用的内部属性:__ngContext__
在调试器里查看__ngContext__属性的值,能知道当前这个指令施加的HTML元素信息,比如下图的TrapFocus指令,施加在cx-table这个DOM标签页上:
Angular class binding的一个例子
[class.selected]="hero.<a [routerLink]="['/hero', hero.<span class="badge">{{ hero.id }}</span>{{ hero.如果逻辑表达式hero.id === selectedId的值为true,...
Angular里的RouterOutlet指令学习笔记
官网:https://angular.Acts as a placeholder that Angular dynamically fills based on the current router state.RouterOutlet作为place holder,Angular...
Angular依赖注入框架injector的学习笔记
An object in the Angular dependency-injection system that can find a named dependency in its cache or create a dependency using a configured...
Angular ngTemplateOutlet元素的学习笔记
*ngTemplateOutlet is used for two scenarios — to insert a common template in various sections of a view irrespective of loops or condition a...
Angular ng-content元素的学习笔记
ng-content 的select 属性其实和 css 选择器的工作方式类似,用于帮助 Angular 找到投影内容在 DOM 中的正确放置位置。我个人把ng-content理解成Component工厂,能根据用户指定的配置信息,动态生成Component,即configura...
Angular ng-container元素的学习笔记
下面这段代码,迭代items集合元素中每一个item,当且仅当item.id不为false时,才在页面显示item.name的属性值。如果item.id为空,最后渲染的页面里会出现空的div, 这是该解决方案的一个小缺陷。在一个复杂的Angular应用里,div嵌套层数如果增多,...
Angular ng-template元素的学习笔记
ng-template: As the name suggests the ng-template is a template element that Angular uses with structural directives (*ngIf, *ngFor, [ngSwit...
使用Angular可重用Component思路实现一个自带图标(icon)的input控件
console.(keyup)="value.emit(input.styleUrls: ['./fa-input.component.cssClasses['fa-' + this.@HostBinding('class.console.log(this.return this...
Angular jasmine TestBed.configureTestingModule的工作原理
TestBed.一次性异步编译所有组件。返回一个promise,可以等其完成时,执行更多的额外任务。
Angular jasmine单元测试框架TestBed.inject的执行原理
TestBed用于单元测试代码里创建Component和service实例。injectionToken即传入TestBed.因为value早就ready了,不需要进入第11243行的record.
Angular jasmine单元测试框架spied method的调用记录数据结构
基于UnknownErrorHandler的handleError方法创建一个spy 方法:第40行调用的是spied之后的新方法:因为调用的是Spied之后的wrapper方法,在wrapper方法
Angular jasmine单元测试框架spec的运行时数据结构
真正的spec由函数it创建:其中expectable是human readable的字符串描述信息,描述该spec具体要测试哪些东西,assertion就是具体的包含单元测试的代码。spec内部的expect方法调用:调用env.
下一页