博文

目前显示的是 十一月, 2016的博文

resolve of angularJS

1 a resove. $routeProvider . when ( '/users' , { templateUrl: '...' , controller: 'UserListController' , resolve: { users: function(User) { return User.getAll(); } } }); app.controller( 'UserListController' , function (users) { $scope .users = users; });   2. $q.all $routeProvider . when ( '/users' , { templateUrl: '...' , controller: 'UserListController' , resolve: { data: function(User, Post, $q ) { deferred = $q .defer(); $q .all([User.getAll, Post.getTops()]).then(function(results) { deferred.resolve({ users: results[ 0 ], posts: results[ 1 ] }) }); return deferred.promise; } } });   ref: boiajs . c om/ 2015/ 08/ 27/ angular-route-use-resolve

console api of chrome

console.assert(expression, object) console.clear() console.count(label) console.debug(object [, object, …]) console.dir(object) console.dirxml(object) console.error(object [, object, …]) console.group(object[, object, …]) console.groupCollapsed(object[, object, …]) console.groupEnd() console.info(object) console.profile([label])   console .profileEnd(); console.time(label1)  --  console.timeEnd(label1) console.timeStamp([label]) console.warn(object [, object, …]) console.trace(object)  console.log("$s,$i,%d,$f,%o,%O,%c","s","1","2","2334.24","<html>DOM","jsObject","css") debugger ref: boiajs . c o m/ 201 5 /12/01 /chrome-debug-skill -console-api

node-async

install Async   bower install async --save npm install async --save jam install async spm install async component install caolan/async   .waterfall async.waterfall([ function (callback) { getUserById(userId, function (user) { callback ( null , user); }); }, function (user, callback) { getDepartmentByUser(user.id, function (department) { callback ( null , department); }); }, function (department, callback) { getUserById(department.id, function (users) { console.log(users) callback ( null ); }); } ])   parallel async.parallel([ function (callback) { getUsers( function (users) { callback ( null , users); }); }, function (callback) { getDepartments( function (departments) { callback ( null , departments); }); }, function (callback) { getTasks( function (tasks) { callback ( null , tasks); }); } ], function (err, results) { console.l...

How to create a custom input validator with AngularJS

http://angularjs.io/how-to-create-a-custom-input-validator-with-angularjs/

Style Guide of angular 2

https://angular.io/docs/ts/latest/guide/style-guide.html https://angular.cn/docs/ts/latest/guide/style-guide.html https://github.com/johnpapa/angular-styleguide

Victory won't come to me unless I go to it.

Victory won't come to me unless I go to it. The distance between your dreams and reality is called action. There are only two creature who can surmount the pyramids--the eagle and the snail. It's never too late to do the right thing. We must face tomorrow, whatever it may hold, with determination, joy, and bravery. Life is a roller coaster. You can scream every time you hit a bump, or you can throw your hands up and enjoy the ride. Death is so final, whereas life is so full of possibilities. For some men, nothing is written unless they write it. Progress is impossible without change, and those who cannot change their minds cannot change anything. Victory won't come to me unless I go to it.