@ -40,7 +40,7 @@ function asyncValidator(expected: any, timeout = 0) {
|
||||
};
|
||||
}
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('Form Directives', () => {
|
||||
let defaultAccessor: DefaultValueAccessor;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors} fr
|
||||
import {of } from 'rxjs/observable/of';
|
||||
import {Validators} from '../src/validators';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function asyncValidator(expected: string, timeouts = {}) {
|
||||
return (c: AbstractControl) => {
|
||||
let resolve: (result: any) => void = undefined !;
|
||||
@ -1100,4 +1100,4 @@ export function main() {
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -9,7 +9,7 @@
|
||||
import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
||||
import {FormBuilder} from '@angular/forms';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function syncValidator(_: any /** TODO #9100 */): any /** TODO #9100 */ { return null; }
|
||||
function asyncValidator(_: any /** TODO #9100 */) { return Promise.resolve(null); }
|
||||
|
||||
@ -67,4 +67,4 @@ export function main() {
|
||||
expect(a.asyncValidator).toBe(asyncValidator);
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -13,7 +13,7 @@ import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||
|
||||
import {FormArray} from '../src/model';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function asyncValidator(expected: string, timeouts = {}) {
|
||||
return (c: FormControl) => {
|
||||
let resolve: (result: any) => void = undefined !;
|
||||
@ -1142,4 +1142,4 @@ export function main() {
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -13,7 +13,7 @@ import {AbstractControl, FormArray, FormControl, FormGroup, ValidationErrors, Va
|
||||
import {of } from 'rxjs/observable/of';
|
||||
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function simpleValidator(c: AbstractControl): ValidationErrors|null {
|
||||
return c.get('one') !.value === 'correct' ? null : {'broken': true};
|
||||
}
|
||||
@ -1126,4 +1126,4 @@ export function main() {
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -18,7 +18,7 @@ import {_do} from 'rxjs/operator/do';
|
||||
|
||||
import {MyInput, MyInputForm} from './value_accessor_integration_spec';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('reactive forms integration tests', () => {
|
||||
|
||||
function initTest<T>(component: Type<T>, ...directives: Type<any>[]): ComponentFixture<T> {
|
||||
|
@ -16,7 +16,7 @@ import {merge} from 'rxjs/observable/merge';
|
||||
|
||||
import {NgModelCustomComp, NgModelCustomWrapper} from './value_accessor_integration_spec';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('template-driven forms integration tests', () => {
|
||||
|
||||
function initTest<T>(component: Type<T>, ...directives: Type<any>[]): ComponentFixture<T> {
|
||||
|
@ -17,7 +17,7 @@ import {map} from 'rxjs/operator/map';
|
||||
import {normalizeAsyncValidator} from '../src/directives/normalize_validator';
|
||||
import {AsyncValidator, ValidationErrors, ValidatorFn} from '../src/directives/validators';
|
||||
|
||||
export function main() {
|
||||
(function(){
|
||||
function validator(key: string, error: any): ValidatorFn {
|
||||
return (c: AbstractControl) => {
|
||||
const r: ValidationErrors = {};
|
||||
@ -435,4 +435,4 @@ export function main() {
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@ -12,7 +12,7 @@ import {AbstractControl, ControlValueAccessor, FormControl, FormGroup, FormsModu
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util';
|
||||
|
||||
export function main() {
|
||||
{
|
||||
describe('value accessors', () => {
|
||||
|
||||
function initTest<T>(component: Type<T>, ...directives: Type<any>[]): ComponentFixture<T> {
|
||||
|
Reference in New Issue
Block a user