11 2015 档案

摘要:Sometimes we need to turn arrays into new values in ways that can't be done purely by passing an accumulator along with no knowledge about its context... 阅读全文
posted @ 2015-11-30 20:30 Zhentiw 编辑
摘要:Learn how to use Object.assign() and the spread operator proposed for ES7 to avoid mutating objects./* * Open the console to see * that the tests have... 阅读全文
posted @ 2015-11-30 03:31 Zhentiw 编辑
摘要:Learn how two common array functions - map() and filter() - are syntactic sugar for reduce operations. Learn how to use them, how to compose them, and... 阅读全文
posted @ 2015-11-29 18:00 Zhentiw 编辑
摘要:For Redux, you cannot use mutable methods like push, splice. Need to use immutable methods such as concat, slice and ...spreadHtml: JS Bin push(... 阅读全文
posted @ 2015-11-29 01:29 Zhentiw 编辑
摘要:Currying is a core concept of functional programming and a useful tool for any developer's toolbelt.Example 1:let f = a => b => c => a+b+c;let result ... 阅读全文
posted @ 2015-11-29 00:50 Zhentiw 编辑
摘要:Array slice creates a shallow copy of an array. In this lesson we cover, in detail, exactly what a 'shallow' copy is and how it can trip people up. We... 阅读全文
posted @ 2015-11-27 03:50 Zhentiw 编辑
摘要:var parts = ['shoulders', 'knees'];var lyrics = ['head', ...parts, 'and', 'toes']; // ["head", "shoulders", "knees", "and", "toes"]var arr1 = [0, 1, 2... 阅读全文
posted @ 2015-11-27 03:06 Zhentiw 编辑
摘要:angular.module('MyApplication', ['ngAnimate']) .controller('ApplicationController', ['$interval', function($interval) { var banner... 阅读全文
posted @ 2015-11-27 01:48 Zhentiw 阅读(482) 评论(0) 推荐(0) 编辑
摘要:Before you use the React Redux bindings, learn how to create a complete simple application with just React and Redux. JS Bin const counter = ... 阅读全文
posted @ 2015-11-26 03:38 Zhentiw 编辑
摘要:Learn how to build a reasonable approximation of the Redux Store in 20 lines. No magic!const counter = (state = 0, action) => { switch (action.type) ... 阅读全文
posted @ 2015-11-26 02:12 Zhentiw 编辑
摘要:console.clear();const counter = (state = 0, action) => { switch (action.type) { case 'INCREMENT': return state + 1; case 'DECREMENT': ... 阅读全文
posted @ 2015-11-25 03:17 Zhentiw 编辑
摘要:Single immutable state tree: Should be just one single javascript object.Describing the changes by action: every change in the application state as ... 阅读全文
posted @ 2015-11-25 03:03 Zhentiw 编辑
摘要:Recursion is a technique well suited to certain types of tasks. In this first lesson we’ll look at solving a problem that requires the flattening of a... 阅读全文
posted @ 2015-11-24 02:49 Zhentiw 编辑
摘要:Protractor Page Objects are a recommended for testing your AngularJS applications. Page Objects abstract the interaction between the browser and your ... 阅读全文
posted @ 2015-11-23 02:23 Zhentiw 编辑
摘要:Protractor is built to interact with AngularJS applications. In this lesson, we will take a look at how Protractor interacts with the application usin... 阅读全文
posted @ 2015-11-23 02:09 Zhentiw 编辑
摘要:When you create a Form in Angular 2, you can easily get all the values from the Form using ControlGroup and Controls.Bind [ng-form-model] to the form ... 阅读全文
posted @ 2015-11-23 01:29 Zhentiw 编辑
摘要:Array.from()lets you convert an "iterable" object (AKA anarray-likeobject) to an array. In this lesson, we go over grabbing DOM nodes and turing them ... 阅读全文
posted @ 2015-11-22 23:04 Zhentiw 编辑
摘要:JSON is a very commonly used data interchange format. Unfortunately while most application domain models are graphs, JSON is designed to model hierarc... 阅读全文
posted @ 2015-11-21 18:56 Zhentiw 编辑
摘要:$stateProvider .state('landing', { url: '/', views: { 'body@': { ... 阅读全文
posted @ 2015-11-19 04:39 Zhentiw 编辑
摘要:In addition to being able to retrieve a path from a Falcor Model, you can also retrieve multiple Path Sets. Path Sets are paths that contain ranges or... 阅读全文
posted @ 2015-11-19 02:16 Zhentiw 编辑
摘要:1. Use or create a database:use wandRecorderYou will use keyword to create or fetch a exicting database.2. Find all documents in the database.db.wands... 阅读全文
posted @ 2015-11-15 23:49 Zhentiw 编辑
摘要:Protractor is an end-to-end testing library for AngularJS.Install:npm install -g protractorThis will install two command line tools,protractorandwebdr... 阅读全文
posted @ 2015-11-15 05:19 Zhentiw 编辑
摘要:Refer:http://toddmotto.com/super-fast-angular-ng-model-options-limit-digest-cycles/Use:With Angular Formly:Refer:http://angular-formly.com/#/example/f... 阅读全文
posted @ 2015-11-14 23:28 Zhentiw 编辑
摘要:The application will dislay a some catalogs, and each catalog has title image, description.Catalog:import React from 'react';import AppStore from '../... 阅读全文
posted @ 2015-11-14 23:12 Zhentiw 编辑
摘要:Store, in Flux which manager the state of the application.You can use EventEmiiter to listen to the change to state.import {dispatch, register} from '... 阅读全文
posted @ 2015-11-14 22:44 Zhentiw 编辑
摘要:GO to setting, search Terminal:Change shell path :C:\cygwin\bin\bash.exe --login -i (to the local which you install cygwin)Change the default pwd to ... 阅读全文
posted @ 2015-11-13 01:57 Zhentiw 编辑
摘要:ng-show:ng-show element will stay in dom, just added a ng-hide attr, so it won't show.ng-if:It has its own scope.Element is not display in the dom if ... 阅读全文
posted @ 2015-11-12 03:27 Zhentiw 编辑
摘要:Convenient method to find one item in an array, avoid writing and for + if:let arys = [1,,5,,6] ;let target = 6;let res = arys.find(item => item === t... 阅读全文
posted @ 2015-11-12 03:23 Zhentiw 编辑
摘要:In es5, you can use indexOf to get the index of one item in an array.In es6, you can use findIndex(), which is more prowful:[NaN].indexOf(NaN) // -1[N... 阅读全文
posted @ 2015-11-12 03:16 Zhentiw 编辑
摘要:Best Pratices for Object.assign: http://www.cnblogs.com/Answer1215/p/5096746.html Object.assign() can extend the object by adding new props: let obj = 阅读全文
posted @ 2015-11-12 03:13 Zhentiw 编辑
摘要:An introduction to the Web Audio API. In this lesson, we cover creating an audio context and an oscillator node that actually plays a sound in the bro... 阅读全文
posted @ 2015-11-11 01:47 Zhentiw 编辑
摘要:How to work with JSON data indirectly through a Falcor Model. The Falcor Model allows you to work with data using the same familiar JavaScript path sy... 阅读全文
posted @ 2015-11-09 02:47 Zhentiw 编辑
摘要:Use the Falcor Router to create a Virtual JSON resource. In this tutorial we will use Falcor’s express middleware to serve the Virtual JSON resource o... 阅读全文
posted @ 2015-11-09 02:34 Zhentiw 编辑
摘要:You can watch for form / control changes by using .valueChanges.observe({...}): this.sku.valueChanges.observer({ next: (value)=>{ ... 阅读全文
posted @ 2015-11-09 01:55 Zhentiw 编辑
摘要:Create a custom validtor which only accepts the string start with '123'; function skuValidator(control){ if(!control.value.match(/^123/)){ ... 阅读全文
posted @ 2015-11-09 01:48 Zhentiw 编辑
摘要:In last post, we need to create an instanse variable:sku: AbstructControl;We can get rid of this by getting the exported form from NgFormControl, what... 阅读全文
posted @ 2015-11-09 01:37 Zhentiw 编辑
摘要:Define a filed should has validation: export class DemoFormSku { myForm: ControlGroup; sku: AbstractControl; constructor(fb:FormBuilder) { this.myForm 阅读全文
posted @ 2015-11-06 04:04 Zhentiw 编辑
摘要:There are two main functions we’ll use on FormBuilder:•control - creates a new Control• group - creates a new ControlGroupimport {Component, bootstrap... 阅读全文
posted @ 2015-11-06 02:55 Zhentiw 编辑
摘要:Control:Controls encapsulate the field's value, a states such as if it is valid, dirty or has errors.var nameControl = new Control("Nate");var name = ... 阅读全文
posted @ 2015-11-06 02:40 Zhentiw 编辑
摘要:If you want to print someting like {{content}} on the html, using ng-non-bindable directive: 阅读全文
posted @ 2015-11-06 02:10 Zhentiw 编辑
摘要:Optional ArgumentsSet default arguments, when we don't need to call it, we can simply skip it.def new_game(name, year=nil, system=nil) { name: nam... 阅读全文
posted @ 2015-11-02 02:52 Zhentiw 编辑
摘要:1. Rails commends line:Example:rails new blog --skip-test-unit --database=postgresql 阅读全文
posted @ 2015-11-02 02:51 Zhentiw 编辑
摘要:Nowdays, Single page apps are becoming increasingly popularamong the fornt-end developers. It is the time to say goodbye with refreshing the whole pag... 阅读全文
posted @ 2015-11-02 02:50 Zhentiw 编辑
摘要:To Currencyfunction toCurrency(price){ return price.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");}Deletion from Array:function deleteValues(a... 阅读全文
posted @ 2015-11-02 02:48 Zhentiw 编辑
摘要:Besides @Input(), we can also use properties on the @Component, to pass the data.import {Component, View, NgFor, Input} from 'angular2/angular2';@Comp... 阅读全文
posted @ 2015-11-02 02:47 Zhentiw 编辑
摘要:Inheritance is a way toindicate that a class receives behavior from a parent class. Then we can override, modify or augmentthose behaviors on the new ... 阅读全文
posted @ 2015-11-02 02:43 Zhentiw 编辑
摘要:Showing how to set up a Pipe that takes multiple updating inputs for multiple Component sources.import {Component, View, NgFor, FORM_DIRECTIVES} from ... 阅读全文
posted @ 2015-11-01 17:33 Zhentiw 编辑
摘要:This lesson shows you how to create a component and pass its properties as it updates into a Pipe to make a simple searchable list.import {Pipe} from ... 阅读全文
posted @ 2015-11-01 04:33 Zhentiw 编辑
摘要:Explaining how Pipes only change by default when your Pipe input parameters change and not when your data changes. It also shows you how to make an “u... 阅读全文
posted @ 2015-11-01 03:41 Zhentiw 编辑
摘要:Showing you how you can expose properties on your Controller to access them using #refs inside of your template.// letterSelect.tsimport {Component, V... 阅读全文
posted @ 2015-11-01 03:33 Zhentiw 编辑
摘要:You can use Select and Option elements in combination with ng-for and ng-model to create mini-forms that change your data as you make a selection./** ... 阅读全文
posted @ 2015-11-01 03:21 Zhentiw 编辑

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