Vincent's Blog


  • Home

  • Categories

  • Archives

  • Tags

Angular2 - Directive - CheckboxControlValueAccessor

Posted on 2016-01-19   |   In Angular2
前一阵时间心里稍有烦躁,去看看下react 和redux, 今天回来继续踏实解读 CheckboxControlValueAccessor - 直接翻译就是访问器源码/** * The accessor for writing a value and listening to changes on ...
Read more »

Koa 中间件方式理解

Posted on 2016-01-11   |   In Node
对 koa 的理解源于一次 node 群的讨论。 官网例子: var koa = require("koa")var app = koa()// loggerapp.use(function*(next) { var start = new Date() yield next var ...
Read more »

Angular2 - DynamicComponentLoader 用法

Posted on 2016-01-11   |   In Angular2
DynamicComponentLoader 主要的能力就是动态加载组件: 文档给出了3个用法 1 constructor(dcl: DynamicComponentLoader, injector: Injector) { dcl.loadAsRoot(ChildCompon ...
Read more »

Angular2 - 复杂指令- *ngError

Posted on 2016-01-07   |   In Angular2
需求: 想实现一个类似*ngIf 的指令 - 接受参数的模板指令 下面代码效果 *ngError 接受一个正则表达式内部的string (不要 / / 的) 指令内判断当前所在div(可编辑的)的内容符合正则 则触发向DOM里添加元素。 之前触发后,当不符合时,去除元素Message im ...
Read more »

快速创建大量String 为DOM

Posted on 2016-01-07   |   In JS
直接上方法var s = '<li>text</li>'; // HTML stringvar div = document.createElement('div');div.innerHTML = s;
Read more »

Angular2 - ngIf - 源码解读

Posted on 2016-01-06   |   In Angular2
先上源码 @Directive({selector: '[ngIf]', inputs: ['ngIf']})export class NgIf { private _prevCondition: boolean = null; constructor(privat ...
Read more »

Angular2 - host

Posted on 2016-01-05   |   In Angular2
总结Component对象的参数host中放入的任何event,class等皆是指向本组件的 讨论来源: Material Button @Component({ selector: '[md-button]:not(a), [md-fab]:not(a), [md-raised-but ...
Read more »

Angular2 - hook methods

Posted on 2016-01-04   |   In Angular2
the life cycle of the component events #Very Useful ngOnChanges - called when an input or output binding value changes ngOnInit - after the first n ...
Read more »

Angular2 - Simple Route

Posted on 2015-12-29   |   In Angular2
需求最简化路由 - 直接来代码import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';import {Component} from 'angular2/core';import { ...
Read more »

Angular2 - Directive - rotate

Posted on 2015-12-29   |   In Angular2
需求说明 rotate属性 当mouseenter的时候当前元素旋转 实现就是加减class import {Directive, ElementRef, Renderer, Input} from 'angular2/core';@Directive({ se ...
Read more »
<i class="fa fa-angle-left"></i>1…252627…29<i class="fa fa-angle-right"></i>
Vincent Guo

Vincent Guo

the blog to remeber all things about code

290 posts
44 categories
103 tags
RSS
github twitter facebook google weibo
Links
  • KunLin
  • Rx Introduction
  • 三哥
  • 元龙
© 2024 Vincent Guo
Powered by Hexo
Theme - NexT.Mist