docs: create public API surface

Closes #1181
This commit is contained in:
Misko Hevery
2015-03-31 22:47:11 +00:00
parent c1aa65239e
commit 86dc3e5b07
23 changed files with 115 additions and 10 deletions

View File

@ -10,6 +10,9 @@ import {Validators} from './validators';
// set onChange(fn){}
//}
/**
* @publicModule angular2/forms
*/
@Decorator({
selector: '[control]',
events: {
@ -31,6 +34,9 @@ export class DefaultValueAccessor {
}
}
/**
* @publicModule angular2/forms
*/
@Decorator({
selector: 'input[type=checkbox][control]',
events: {
@ -52,6 +58,9 @@ export class CheckboxControlValueAccessor {
}
}
/**
* @publicModule angular2/forms
*/
@Decorator({
lifecycle: [onChange],
selector: '[control]',
@ -109,6 +118,9 @@ export class ControlDirective {
}
}
/**
* @publicModule angular2/forms
*/
@Decorator({
selector: '[control-group]',
bind: {
@ -157,6 +169,10 @@ export class ControlGroupDirective {
}
}
/**
* @publicModule angular2/forms
*/
// todo(misko): rename to lover case as it is not a Type but a var.
export var FormDirectives = [
ControlGroupDirective, ControlDirective, CheckboxControlValueAccessor, DefaultValueAccessor
];

View File

@ -3,6 +3,9 @@ import {isPresent} from 'angular2/src/facade/lang';
import * as modelModule from './model';
/**
* @publicModule angular2/forms
*/
export class FormBuilder {
group(controlsConfig, extra = null):modelModule.ControlGroup {
var controls = this._reduceControls(controlsConfig);

View File

@ -3,7 +3,14 @@ import {Observable, ObservableController, ObservableWrapper} from 'angular2/src/
import {StringMap, StringMapWrapper, ListWrapper, List} from 'angular2/src/facade/collection';
import {Validators} from './validators';
/**
* @publicModule angular2/forms
*/
export const VALID = "VALID";
/**
* @publicModule angular2/forms
*/
export const INVALID = "INVALID";
//interface IControl {
@ -18,6 +25,9 @@ export const INVALID = "INVALID";
// setParent(parent){}
//}
/**
* @publicModule angular2/forms
*/
export class AbstractControl {
_value:any;
_status:string;
@ -69,6 +79,9 @@ export class AbstractControl {
}
}
/**
* @publicModule angular2/forms
*/
export class Control extends AbstractControl {
constructor(value:any, validator:Function = Validators.nullValidator) {
super(validator);
@ -94,6 +107,9 @@ export class Control extends AbstractControl {
}
}
/**
* @publicModule angular2/forms
*/
export class ControlGroup extends AbstractControl {
controls:StringMap;
_optionals:StringMap;
@ -169,6 +185,9 @@ export class ControlGroup extends AbstractControl {
}
}
/**
* @publicModule angular2/forms
*/
export class ControlArray extends AbstractControl {
controls:List;

View File

@ -3,6 +3,9 @@ import {List, ListWrapper, StringMapWrapper} from 'angular2/src/facade/collectio
import * as modelModule from './model';
/**
* @publicModule angular2/forms
*/
export class Validators {
static required(c:modelModule.Control) {
return isBlank(c.value) || c.value == "" ? {"required": true} : null;