12 2015 档案
摘要:we leverage private components to break our render function into more manageable pieces without leaking the implementation details of our component. ...
阅读全文
摘要:indexOf is used to search for a value or reference inside of an array. In this lesson we first look at what values are returned when a search is succe...
阅读全文
摘要:When using recursion, you must be mindful of the dreadedinfinite loop. Using the recursive function that we’ve built up over the previous lessons, we ...
阅读全文
摘要:var falcorExpress = require( 'falcor-express' );var falcor = require('falcor');var express = require( 'express' );var app = express();var ...
阅读全文
摘要:// Save datavar storage = require('node-persist');storage.init();var people= require('./people.json');people.forEach( (person)=>{ storage.setItem(per...
阅读全文
摘要:var ary = [ { id: 1, name: "Zhentian" }, { id: 2, name: "Alice" }];for..inPrint out the props namefor(let person in ary){ console.log...
阅读全文
摘要:model.setValue('genreList[0].titles[0].rating', 5) .then(function (value) { model.get('genreList[0..1].title...
阅读全文
摘要:Code: Joe Maddalone Instructor egghead.io Using parent compoment in css :hostremov...
阅读全文
摘要:install Polymer and explore creating our first custom element: bower install polymerindex.html: Polymer include webcomponents-list.j...
阅读全文
摘要:The combineReducers function we used in previous post:const todoApp = combineReducers({ todos, visibilityFilter});It accepts and object as agruement...
阅读全文
摘要:Previous, we do composition with objects:const todoApp = (state = {}, action) => { return { todos: todos( state.todos, action ), v...
阅读全文
摘要:Angualr 1.4:.directive('counter', function counter() { return { scope: {}, restrict: 'EA', transclude: true, bindToController: { cou...
阅读全文
摘要:ngMessageFormatcan be installed via npm using the following command:$ npm install angular-message-format --saveangular.module('myApp', ['ngMessageForm...
阅读全文
摘要:ngPluralizeis a directive that displays messages according to en-US localization rules. Person 1: Person 2: Number of People: Without Offset: ...
阅读全文
摘要:Modernizris a library for detecting whether the user's browsers have certain features and based on the availability, we developers will trigger certai...
阅读全文
摘要:Array filter creates a new array with all elements that pass the test implemented by the provided function. In this lesson we discuss how only a truth...
阅读全文
摘要:Using mocha: "devDependencies": { "should": "^5.2.0", "supertest": "^0.15.0" } process.env.A127_ENV = 'test'; var should = require('should'); var requ
阅读全文
摘要:The interactive pseudo-classes for links (and buttons) allow us to make sure the user knows what elements on the page are interactive and that they ca...
阅读全文
摘要:Previous post:http://www.cnblogs.com/Answer1215/p/4990418.htmllet input, config, tasks;input = ['dist'];config = { "dist": ["build", "deploy"], "bui...
阅读全文
摘要:Sort can automatically arrange items in an array. In this lesson we look at the basics including how to sort an array of strings alphabetically and th...
阅读全文
摘要:Learn a few advanced reduction patterns: flatten allows you to merge a set of arrays into a single array, the dreaded flatmap allows you to convert an...
阅读全文
摘要:For example, current we have those todos:{ todos: [ { completed: true, id: 0, text: "Learn Redux"}, { completed: false, id: 1, text: "Go shoppi...
阅读全文
摘要:Creating a Value ObjectSometimes you have javascript object defined: //value object var droidValue = { name: '', speak: function (...
阅读全文
摘要:Creating a Service:Before actual create an angular service, first create a constructor in Javascript: //constructor function function DroidServi...
阅读全文
摘要:// backend test beforeEach(inject(function (_$compile_, _$httpBackend_, _$rootScope_, _$state_, _AnnouncementsService_, _CONFIG_) { ...
阅读全文
摘要:In the previous lesson we created a reducer that can handle two actions, adding a new to-do, and toggling an existing to-do. Right now, the code to up...
阅读全文
摘要:Learn how to implement toggling a todo in a todo list application reducer.let todo = (state = [], action) => { switch(action.type){ case 'ADD_IT...
阅读全文
摘要:Learn how to implement adding a todo in a todo list application reducer.let todo = (state = [], action) => { switch(action.type){ case 'ADD_ITEM...
阅读全文
摘要:Take away:Always check you ruturn the accumulatorAlways pass in the inital valuevar data = ["vote1", "vote2", "vote1", "vote2"];var reducer = function...
阅读全文