随笔分类 -  Angular

上一页 1 2 3 4 5 6 ··· 23 下一页
摘要:Right now, we're getting the ID route parameter off the of the parent route. This is because we want the info and items components to use the ID of th 阅读全文
posted @ 2020-07-21 15:43 Zhentiw 阅读(205) 评论(0) 推荐(0) 编辑
摘要:in angular.json: "configurations": { "production": { "index": { "input": "src/index.prod.html", "output": "index.html" }, "fileReplacements": [ { "rep 阅读全文
posted @ 2020-04-29 19:26 Zhentiw 阅读(213) 评论(0) 推荐(0) 编辑
摘要:For example we have multi API calls for one single page. this.course$ = this.coursesService.loadCourseById(courseId) this.essons$ = this.coursesServic 阅读全文
posted @ 2020-04-19 00:42 Zhentiw 阅读(601) 评论(0) 推荐(0) 编辑
摘要:Let's say we want to dynamiclly change some style in :before or :after element. We cannot use NgStyle, it doesn's support this use case, what we can d 阅读全文
posted @ 2020-03-31 02:30 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
摘要:In angular.json 阅读全文
posted @ 2020-03-29 00:19 Zhentiw 阅读(135) 评论(0) 推荐(0) 编辑
摘要:Component to be tested: <ng-template #defaultPlaceholder> Loading... </ng-template> <div class="loading-container" *ngIf="loading$ | async"> <ng-conta 阅读全文
posted @ 2020-03-25 19:29 Zhentiw 阅读(3381) 评论(0) 推荐(0) 编辑
摘要:Component: <div class="loading-placeholder" [ngClass]="extraClass"> &nbsp; <ng-container *ngIf="loadingService.config.showContent"> <ng-content></ng-c 阅读全文
posted @ 2020-03-24 22:15 Zhentiw 阅读(263) 评论(0) 推荐(0) 编辑
摘要:Let's say we have App.component.ts, it use provider inside component level: @Component({ selector: 'app-root', templateUrl: './app.component.html', st 阅读全文
posted @ 2020-03-14 04:37 Zhentiw 阅读(153) 评论(0) 推荐(0) 编辑
摘要:For example, we want to show loading spinner inside our appliction component trees. Because we might trigger loading spinner anywhere inside our appli 阅读全文
posted @ 2020-03-07 00:20 Zhentiw 阅读(415) 评论(0) 推荐(0) 编辑
摘要:When new to Reactive programming with Angular. It is easy to fall into a performance issue, which is sending multi same http request to the backend. I 阅读全文
posted @ 2020-03-05 21:31 Zhentiw 阅读(350) 评论(0) 推荐(0) 编辑
摘要:Component: import { Component, OnInit } from "@angular/core"; import { TwainService } from "../twain.service"; import { Observable, of } from "rxjs"; 阅读全文
posted @ 2020-03-03 17:55 Zhentiw 阅读(478) 评论(0) 推荐(0) 编辑
摘要:Generate a certificate git clone https://github.com/RubenVermeulen/generate-trusted-ssl-certificate.git cd generate-trusted-ssl-certificatebash genera 阅读全文
posted @ 2020-02-28 21:37 Zhentiw 阅读(400) 评论(0) 推荐(0) 编辑
摘要:The component we test against: import {Component, OnInit} from '@angular/core'; import {Course} from "../model/course"; import {Observable} from "rxjs 阅读全文
posted @ 2020-02-25 19:55 Zhentiw 阅读(342) 评论(0) 推荐(0) 编辑
摘要:In this post, we are going to see how to use 'fakeAsync' to test async code in Angular Context. fakeAsync using Zoom.js underhook, it detects all the 阅读全文
posted @ 2020-02-20 17:59 Zhentiw 阅读(285) 评论(0) 推荐(0) 编辑
摘要:The smart component we want to test: import {Component, OnInit} from '@angular/core'; import {Course} from "../model/course"; import {Observable} from 阅读全文
posted @ 2020-02-19 17:17 Zhentiw 阅读(967) 评论(0) 推荐(0) 编辑
摘要:Html: <input type="range" value="0" [style.--thumb-rotate]="720 * $any(input.value)/100 + 'deg'" #input (input)="0"> CSS: input[type="range"]::-webkit 阅读全文
posted @ 2020-02-17 17:30 Zhentiw 阅读(260) 评论(0) 推荐(0) 编辑
摘要:The $any() type cast function Sometimes a binding expression triggers a type error during AOT compilation and it is not possible or difficult to fully 阅读全文
posted @ 2020-02-17 17:28 Zhentiw 阅读(197) 评论(0) 推荐(0) 编辑
摘要:@Injectable({ providedIn: "root" | "any" | "platform" }) export class MyService {} More ProvidedIn: root Every service defined with 'root' will be pro 阅读全文
posted @ 2020-02-17 17:21 Zhentiw 阅读(405) 评论(0) 推荐(0) 编辑
摘要:In Angular version 8, TestBed.get was deprecated. In Angular version 9, we see why: TestBed.inject<T> is introduced as a type-safe replacement. There 阅读全文
posted @ 2020-02-17 16:48 Zhentiw 阅读(142) 评论(0) 推荐(0) 编辑
摘要:When we redirect to a different route from within our component's code using the Router.navigate or from within a component template via a [routerLink 阅读全文
posted @ 2020-02-16 23:15 Zhentiw 阅读(286) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 23 下一页
点击右上角即可分享
微信分享提示