05 2017 档案

摘要:Every movie needs a director and every rented movie needs to exist in the store. How do we make sure something in another table exists before insertin 阅读全文
posted @ 2017-05-31 21:08 Zhentiw 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Let’s say we have a bank. Our bank wants to give each account for each user a unique name, for instance, “Personal” or “Checking.” How can we make sur 阅读全文
posted @ 2017-05-31 21:03 Zhentiw 阅读(193) 评论(0) 推荐(0) 编辑
摘要:.share() is an alias for .publish().refCount(). So if the source is not yet completed, no matter how many subscribers subscribe to the source, they sh 阅读全文
posted @ 2017-05-31 18:27 Zhentiw 阅读(751) 评论(0) 推荐(0) 编辑
摘要:Eventually you will feel the need for pausing the observation of an Observable and resuming it later. In this lesson we will learn about use cases whe 阅读全文
posted @ 2017-05-30 14:53 Zhentiw 阅读(310) 评论(0) 推荐(0) 编辑
摘要:This lesson will highlight the true purpose of the zip operator, and how uncommon its use cases are. In its place, we will learn how to use the combin 阅读全文
posted @ 2017-05-29 14:33 Zhentiw 阅读(374) 评论(0) 推荐(0) 编辑
摘要:Manually unsubscribing from subscriptions is safe, but tedious and error-prone. This lesson will teach us about the takeUntil operator and its utility 阅读全文
posted @ 2017-05-29 14:07 Zhentiw 阅读(240) 评论(0) 推荐(0) 编辑
摘要:The use of RxJS Subjects is common, but not without problems. In this lesson we will see how they can be usually safely replaced with plain Observable 阅读全文
posted @ 2017-05-26 19:16 Zhentiw 阅读(191) 评论(0) 推荐(0) 编辑
摘要:The 2xx family of status codes are used in HTTP responses to indicate success. Beyond the generic 200 OK status code, there are a set of more specific 阅读全文
posted @ 2017-05-26 15:23 Zhentiw 阅读(233) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll create a Higher Order Component (HOC) that takes care of the key property that React looks for when using map to create elements 阅读全文
posted @ 2017-05-26 15:05 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Lookup types, introduced in TypeScript 2.1, allow us to dynamically create types based on the property keys of an object. We'll use the function spyOn 阅读全文
posted @ 2017-05-24 14:46 Zhentiw 阅读(223) 评论(0) 推荐(0) 编辑
摘要:Let's say you are builing a reuseable component. The style structure like this: If you want to style this input field, it can be quite easy, we can ju 阅读全文
posted @ 2017-05-23 01:59 Zhentiw 阅读(265) 评论(0) 推荐(0) 编辑
摘要:Let's look at several HTTP requests to learn the basic structure of these messages, and how the various elements communicate important information fro 阅读全文
posted @ 2017-05-22 21:15 Zhentiw 阅读(147) 评论(0) 推荐(0) 编辑
摘要:Using it: 阅读全文
posted @ 2017-05-19 15:53 Zhentiw 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Writing SCSS @functions is similar to writing functions in other programming languages; they can accept arguments and have return statements. SCSS pro 阅读全文
posted @ 2017-05-18 15:43 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要:The SCSS @for directive is great when we know how many iterations are required and we only need 1 variable. What if we need multiple variables to iter 阅读全文
posted @ 2017-05-18 15:28 Zhentiw 阅读(298) 评论(0) 推荐(0) 编辑
摘要:In this lesson we'll use a simple GraphQL IDL schema to deploy and explore a fully functional GraphQL service in minutes with graphql-up. Install: Cre 阅读全文
posted @ 2017-05-17 22:51 Zhentiw 阅读(300) 评论(0) 推荐(0) 编辑
摘要:Array: 1. slice() 2. concat 3. spread opreator: 4. Array.from: Object: Shadow copy: 1. object.assign: 2. spread opreator: Deep copy: From lodash: From 阅读全文
posted @ 2017-05-17 01:56 Zhentiw 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'withPropsOnChange' higher order component to help ensure that expensive prop computations are only executed when necessary. Simp 阅读全文
posted @ 2017-05-16 21:11 Zhentiw 阅读(366) 评论(0) 推荐(0) 编辑
摘要:Learn how to user the ‘componentFromProp’ helper and ‘defaultProps’ higher order component to swap the underlying html tag of your component. Sometime 阅读全文
posted @ 2017-05-16 21:04 Zhentiw 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the ‘branch’ and ‘renderNothing’ higher-ordercomponents to render nothing when a certain prop condition ismet. Sometimes you only wan 阅读全文
posted @ 2017-05-16 20:54 Zhentiw 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the ‘branch’ and ‘renderComponent’ higher-order components to show errors or messaging when your component is in a non-optimal state. 阅读全文
posted @ 2017-05-16 15:58 Zhentiw 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'branch' and 'renderComponent' higher-order components to show a spinner while a component loads. 阅读全文
posted @ 2017-05-16 03:57 Zhentiw 阅读(298) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the ‘flattenProp’ higher order component to take a single object prop and spread each of its fields out as a prop. For example,we hav 阅读全文
posted @ 2017-05-15 15:13 Zhentiw 阅读(255) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the ‘withProps’ higher order component to pre-fill a prop, unable to be overridden. withProps, take string as arguement for creating 阅读全文
posted @ 2017-05-15 03:42 Zhentiw 阅读(330) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'mapProps' higher-order component to modify an existing component’s API (its props). 'mapProps' takes incoming props and changes 阅读全文
posted @ 2017-05-15 03:30 Zhentiw 阅读(276) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'lifecycle' higher-order component to conveniently use hooks without using a class component. 阅读全文
posted @ 2017-05-15 03:06 Zhentiw 阅读(386) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'withReducer' higher order component using the alternative reducer form. If you like using reducers in redux, you’ll be able to r 阅读全文
posted @ 2017-05-14 18:38 Zhentiw 阅读(284) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the 'withState' and 'withHandlers' higher order components to easily add local state to—and create a reusable local state pattern for 阅读全文
posted @ 2017-05-14 05:04 Zhentiw 阅读(268) 评论(0) 推荐(0) 编辑
摘要:NgZone, Angular uses it to profiling all the async actions such as setTimeout, http request and animation. For example if you dealing with heavy oprat 阅读全文
posted @ 2017-05-12 03:52 Zhentiw 阅读(1749) 评论(0) 推荐(0) 编辑
摘要:Tachyons provides extensions (-ns, -m, and -l) to many of its classes to help you design for responsive layouts. This lesson walks you through designi 阅读全文
posted @ 2017-05-12 03:40 Zhentiw 阅读(226) 评论(0) 推荐(0) 编辑
摘要:You probably have seen 'foorRoot()' method a lot inside Angular application. Creating a configurable NgModule allows us do the configuration for each 阅读全文
posted @ 2017-05-12 03:37 Zhentiw 阅读(215) 评论(0) 推荐(0) 编辑
摘要:Unlike 'useClass', 'useExisting' doesn't create a new instance when you register your service inside ngmodule. 'useExisting' also can limit the functi 阅读全文
posted @ 2017-05-11 04:32 Zhentiw 阅读(1071) 评论(0) 推荐(0) 编辑
摘要:Using factory provider: Here we create 'DrinkFactory' as a named funciton, this is good for AOT, so recommended doing this way. 阅读全文
posted @ 2017-05-11 04:04 Zhentiw 阅读(1228) 评论(0) 推荐(0) 编辑
摘要:Previously we have 'OpaqueToken', but it is DEPRECATED. The new one is called 'InjectionToken'. The difference between OpaqueToken is for InjectionTok 阅读全文
posted @ 2017-05-11 01:35 Zhentiw 阅读(900) 评论(0) 推荐(0) 编辑
摘要:directive: test: 阅读全文
posted @ 2017-05-10 02:27 Zhentiw 阅读(383) 评论(0) 推荐(0) 编辑
摘要:For example, when testing container component we might import lots of children components, but we didn't actually testing those children components. S 阅读全文
posted @ 2017-05-09 23:54 Zhentiw 阅读(766) 评论(0) 推荐(0) 编辑
摘要:The main idea for testing contianer component is to make sure it setup everythings correctlly. Call the onInit() lifecycle first, then the variables h 阅读全文
posted @ 2017-05-09 23:49 Zhentiw 阅读(313) 评论(0) 推荐(0) 编辑
摘要:Component: Test: 阅读全文
posted @ 2017-05-09 23:16 Zhentiw 阅读(661) 评论(0) 推荐(0) 编辑
摘要:Using pseudo-elements like ::before and ::after we can draw some simple icons without having using image assets which can help reduce the number of re 阅读全文
posted @ 2017-05-08 05:12 Zhentiw 阅读(226) 评论(0) 推荐(0) 编辑
摘要:A solid naming convention makes it less likely to run into naming conflicts and helps establish a semantic pattern that is easier for a team to follow 阅读全文
posted @ 2017-05-08 00:42 Zhentiw 阅读(212) 评论(0) 推荐(0) 编辑
摘要:Component: Test @Input & @Output: 阅读全文
posted @ 2017-05-06 03:33 Zhentiw 阅读(307) 评论(0) 推荐(0) 编辑
摘要:Writing similar classes with minor variations, like utility classes, can be a pain to write and update. Sometimes just a single character is the only 阅读全文
posted @ 2017-05-06 03:15 Zhentiw 阅读(268) 评论(0) 推荐(0) 编辑
摘要:Great improvements and optimizations can be made to the output of bundled code. Prepack provides the ability to optimize code at build-time, producing 阅读全文
posted @ 2017-05-05 18:37 Zhentiw 阅读(304) 评论(0) 推荐(0) 编辑
摘要:Somtime 'async await' can have a bad effect on code proferemence. Let's take a look the below example: In the example, we are doing two await operatio 阅读全文
posted @ 2017-05-04 15:22 Zhentiw 阅读(254) 评论(0) 推荐(0) 编辑
摘要:This lesson shows how regular control flow statements such as try/catch blocks can be used to properly handle errors in asynchronous functions. Oftent 阅读全文
posted @ 2017-05-04 04:42 Zhentiw 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Any function can be made asynchronous, including function expressions, arrow functions, and methods. This lesson shows the syntax for each of the func 阅读全文
posted @ 2017-05-04 04:33 Zhentiw 阅读(209) 评论(0) 推荐(0) 编辑
摘要:table { display: block; overflow: scroll; width: 200px; height:95vh; } 阅读全文
posted @ 2017-05-03 21:00 Zhentiw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:component: 阅读全文
posted @ 2017-05-03 15:03 Zhentiw 阅读(315) 评论(0) 推荐(0) 编辑
摘要:import { Http, Response, ResponseOptions } from '@angular/http'; import { TestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/... 阅读全文
posted @ 2017-05-03 14:50 Zhentiw 阅读(251) 评论(0) 推荐(0) 编辑
摘要:We can write reusable styles with the SCSS @extend or @mixin directives. Which one is better? It depends. A better question is, how do they differ?Ext 阅读全文
posted @ 2017-05-02 23:56 Zhentiw 阅读(254) 评论(0) 推荐(0) 编辑
摘要:In this lesson you will learn what a LoopBack model is, you will create a Product model using the LoopbBack CLI. The product model will be based off t 阅读全文
posted @ 2017-05-02 04:06 Zhentiw 阅读(197) 评论(0) 推荐(0) 编辑
摘要:Learn how to create random integers using JavaScript / TypeScript. 阅读全文
posted @ 2017-05-01 22:56 Zhentiw 阅读(465) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示