04 2016 档案
摘要:If Typescript is the first language in which you've encountered generics, the concept can be quite difficult to understand. We skip the lecture in thi
阅读全文
摘要:Download from npm: https://www.npmjs.com/package/angular-md-table +: Responsive: Has both Mobile view and Desktop view i18n: works well with angular-t
阅读全文
摘要:RxJS allows you to combine streams in various ways. This lesson shows you how to take a click stream and combine it with a store stream to use a value
阅读全文
摘要:Reducers are also often used for changing a single property inside of other reducers. This lesson shows how a type can enter the people reducer, but t
阅读全文
摘要:Add another reducer: Added a 'people' reducer, defined a 'defaultPeople' as default state. In bootstrap, add people reducer to the provideStore(). The
阅读全文
摘要:The components inside of your container components can easily accept Observables. You simply define your custom @Input then use the Async pipe when yo
阅读全文
摘要:Angular 2 allows you to pass values from inputs simply by referencing them in the template and passing them into your Subject.next() call. This lesson
阅读全文
摘要:While action types allow you tell your reducer what action it should take, the payload is the data that your reducer will use to update the state.
阅读全文
摘要:ngrx/store is a library that simplifies common RxJS patterns for managing state and gives you an easy api to use it within your Angular 2 application.
阅读全文
摘要:While you have multiple streams flowing into your scan operator, you'll need to map each stream to the specific values you need to update your state t
阅读全文
摘要:The scan operator in RxJS is the main key to managing values and states in your stream. Scan behaves just as a reduce function would, but scan is able
阅读全文
摘要:Observable.merge allows you take two different source streams and use either one of them to make changes to the same state of your data. This lesson s
阅读全文
摘要:While Angular 2 usually uses event handlers to manage events and RxJS typically uses Observable.fromEvent, a good practice when using Angular 2 and Rx
阅读全文
摘要:Instead of simply pushing numbers on a timer into the template, now we'll move on to pushing actual Dates. We'll still use the Async pipe, but we'll a
阅读全文
摘要:Angular 2 templates use a special Async pipe to be able to render out Observables. This lesson covers the syntax used to create an Observable in Angul
阅读全文
摘要:Something like 'for' or 'while', 'if', they don't create a new scope: Everyting written in for loop can be accessed outside the for loop. So, the prob
阅读全文
摘要:Create a Firebase Servcie: Display the list:
阅读全文
摘要:Pull the docker image: Show all the images: Remove the image: Run the image: Once run the images, you can see the webpage the your docker site url. Li
阅读全文
摘要:if-statements can add serious complexity and beg for refactoring. You can use polymorphic functions to simplify your ifs and dynamically call the appr
阅读全文
摘要:Using CSS media queries allows you to design responsive layout in your web apps and website. We will go over the media query basics in this lesson.
阅读全文
摘要:Source: Link We will looking some opreators for combining stream in RxJS: merge combineLatest withLatestFrom concat forkJoin flatMap / switchMap Merge
阅读全文
摘要:$parse is useful when you want to parse an expression and the context is not defined yet. For example, I have a table component which allows user to p
阅读全文
摘要:Benefit to use child router is Angualr 2 then can lazy load the component on demand. Define a child router by adding three dots `/characters/...`: So
阅读全文
摘要:When we define router in Angualr 2, we use @RouteConcfig() When we want to display component, we use <router-outlet> When we want to navigate to compo
阅读全文
摘要:In a CSS library like Bootstrap we can set a button's style to be "primary" or "secondary" by appending classes. For React components we want to be ab
阅读全文
摘要:So far, when writing these subscribe functions, we haven't returned anything. It is possible return an unsubscribe function from a subscribe function.
阅读全文
摘要:We have been using Observable.create() a lot in previous lessons, so let's take a closer look how does it work. The create function: In deep, create()
阅读全文
摘要:It is quite common to need an Observable that ticks periodically, for instance every second or every 100 miliseconds. We will learn about operators in
阅读全文
摘要:Child: parent:
阅读全文
摘要:This lesson introduces operators empty(), never(), and throw(), which despite being plain and void of functionality, are very useful when combining wi
阅读全文
摘要:Besides converting arrays and promises to Observables, we can also convert other structures to Observables. This lesson teaches how we can convert any
阅读全文
摘要:The of() operator essentially converted a list of arguments to an Observable. Since arrays are often how we structure list of things in JavaScript, we
阅读全文
摘要:List all the docker machine: Can check 'ip' and 'status': List the running container we have: Switch to another docker machine: defualt List all the '
阅读全文
摘要:Array push is used to add elements to the end of an Array. In this lesson we'll see how the push method accepts multiple arguments, can be used to mer
阅读全文
摘要:In Angular 1.5, there is no link and compile. So use if you transclude, you cannot access the fifth arguement in link function, which is transcludeFn.
阅读全文
摘要:RxJS is a lot about the so-called "operators". We will learn most of the important operators, one by one. In this lesson, we will see our first creati
阅读全文
摘要:The Observer object has the functions next() and error(). In this lesson we will see the other (and last) function available on observers, complete(),
阅读全文
摘要:Well, on Windows costs a little bit effort to run docker. 1. You need to enable Virtulization: Oh hp Windows machine, you need to Turn off you laptop
阅读全文
摘要:Whenever we are writing code, we need to remember that things may go wrong. If an error happens in a function, that error will be thrown. Errors can a
阅读全文
摘要:Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatically add a githook when dependencies are installed
阅读全文
摘要:You can also use Promise for http: So for the service, you need to call toPromise() method: Then in your controller, you can get the Promise back: But
阅读全文
摘要:Let's see how to track index when we use 'ngFor: <li *ngFor="#hero of heros | async; let i = index"> <hero-item [hero]="hero" (changed)="thisHero = $e
阅读全文
摘要:Property Binding is bind property NOT attribute! So 'class' is attribute on DOM, but 'class.active' is an property. 'aria-label' is attribute, so need
阅读全文
摘要:In Angular2, sometime we use @Output to pass data to parent component, then parent may pass the data down to another child component. When you want to
阅读全文
摘要:When you want to access child component's method, you can use @ViewChild in the parent: Parent Component: Child Component:
阅读全文
摘要:Just like create html page, you can create a svg tag by: Inside svg, x,y: control the position of element fill: control the color of element height, w
阅读全文
摘要:Async Pipe: The Asynce pipe receive a Promise or Observable as input and subscribes to the input, evetually emitting the value(s) changes arrive. In t
阅读全文
摘要:Define a function type and params type:
阅读全文