Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • anis/anis-next
1 result
Show changes
Showing
with 83 additions and 83 deletions
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit, OnChanges, SimpleChanges } from '@angular/core'; import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { ConeSearch, Resolver } from 'src/app/instance/store/models'; import { ConeSearch, Resolver } from 'src/app/instance/store/models';
...@@ -28,8 +28,8 @@ export class ResolverComponent implements OnInit, OnChanges { ...@@ -28,8 +28,8 @@ export class ResolverComponent implements OnInit, OnChanges {
@Input() resolverIsLoaded: boolean; @Input() resolverIsLoaded: boolean;
@Output() retrieveCoordinates: EventEmitter<string> = new EventEmitter(); @Output() retrieveCoordinates: EventEmitter<string> = new EventEmitter();
public form = new FormGroup({ public form = new UntypedFormGroup({
name: new FormControl('', [Validators.required]) name: new UntypedFormControl('', [Validators.required])
}); });
ngOnInit(): void { ngOnInit(): void {
......
import { FormControl } from '@angular/forms'; import { UntypedFormControl } from '@angular/forms';
import { nanValidator } from './nan-validator.directive'; import { nanValidator } from './nan-validator.directive';
describe('[Instance][ConeSearch][Validators] nanValidator', () => { describe('[Instance][ConeSearch][Validators] nanValidator', () => {
it('should return valid', () => { it('should return valid', () => {
let field = new FormControl(''); let field = new UntypedFormControl('');
expect(nanValidator(field)).toBeNull(); expect(nanValidator(field)).toBeNull();
field.setValue(17); field.setValue(17);
expect(nanValidator(field)).toBeNull(); expect(nanValidator(field)).toBeNull();
}); });
it('should return nan error', () => { it('should return nan error', () => {
let field = new FormControl(''); let field = new UntypedFormControl('');
field.setValue('toto'); field.setValue('toto');
expect(nanValidator(field).nan.value).toBe('toto is not a number'); expect(nanValidator(field).nan.value).toBe('toto is not a number');
}); });
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
import { FormControl } from '@angular/forms'; import { UntypedFormControl } from '@angular/forms';
/** /**
* Validates NaN. * Validates NaN.
...@@ -16,7 +16,7 @@ import { FormControl } from '@angular/forms'; ...@@ -16,7 +16,7 @@ import { FormControl } from '@angular/forms';
* *
* @return {[key: string]: any} | null * @return {[key: string]: any} | null
*/ */
export function nanValidator(control: FormControl): {[key: string]: any} | null { export function nanValidator(control: UntypedFormControl): {[key: string]: any} | null {
const value = parseFloat(control.value); const value = parseFloat(control.value);
const regexp: RegExp = /^\-?\d+([.,]+\d*)?$/; const regexp: RegExp = /^\-?\d+([.,]+\d*)?$/;
const isFloat = regexp.test(control.value); const isFloat = regexp.test(control.value);
......
import { FormControl } from '@angular/forms'; import { UntypedFormControl } from '@angular/forms';
import { rangeValidator } from './range-validator.directive'; import { rangeValidator } from './range-validator.directive';
describe('[Instance][ConeSearch][Validators] rangeValidator', () => { describe('[Instance][ConeSearch][Validators] rangeValidator', () => {
it('should return valid', () => { it('should return valid', () => {
let field = new FormControl('', rangeValidator(0, 10)); let field = new UntypedFormControl('', rangeValidator(0, 10));
field.setValue(7); field.setValue(7);
expect(field.errors).toBeNull(); expect(field.errors).toBeNull();
}); });
it('should return range error', () => { it('should return range error', () => {
let field = new FormControl('', rangeValidator(0, 10)); let field = new UntypedFormControl('', rangeValidator(0, 10));
field.setValue(17); field.setValue(17);
expect(field.errors.range).toBeTruthy(); expect(field.errors.range).toBeTruthy();
field.setValue(-2); field.setValue(-2);
...@@ -18,7 +18,7 @@ describe('[Instance][ConeSearch][Validators] rangeValidator', () => { ...@@ -18,7 +18,7 @@ describe('[Instance][ConeSearch][Validators] rangeValidator', () => {
}); });
it('should return range error with form label', () => { it('should return range error with form label', () => {
let field = new FormControl('', rangeValidator(0, 10, 'toto')); let field = new UntypedFormControl('', rangeValidator(0, 10, 'toto'));
field.setValue(17); field.setValue(17);
expect(field.errors.range.value).toEqual('toto must be between 0 and 10'); expect(field.errors.range.value).toEqual('toto must be between 0 and 10');
}); });
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Directive } from '@angular/core'; import { Directive } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { UntypedFormGroup } from '@angular/forms';
import { Attribute } from 'src/app/metamodel/models'; import { Attribute } from 'src/app/metamodel/models';
import { Criterion } from 'src/app/instance/store/models'; import { Criterion } from 'src/app/instance/store/models';
...@@ -19,7 +19,7 @@ export abstract class AbstractSearchTypeComponent { ...@@ -19,7 +19,7 @@ export abstract class AbstractSearchTypeComponent {
attribute: Attribute; attribute: Attribute;
criteriaList: Criterion[]; criteriaList: Criterion[];
form: FormGroup; form: UntypedFormGroup;
operators = searchTypeOperators; operators = searchTypeOperators;
nullOrNotNull: string = ''; nullOrNotNull: string = '';
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, BetweenCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, BetweenCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -26,9 +26,9 @@ export class BetweenDateComponent extends AbstractSearchTypeComponent { ...@@ -26,9 +26,9 @@ export class BetweenDateComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl(), label: new UntypedFormControl(),
dateRange: new FormControl('', [Validators.required]) dateRange: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, BetweenCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, BetweenCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -26,10 +26,10 @@ export class BetweenComponent extends AbstractSearchTypeComponent { ...@@ -26,10 +26,10 @@ export class BetweenComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl('', [Validators.required]), label: new UntypedFormControl('', [Validators.required]),
min: new FormControl('', [Validators.required]), min: new UntypedFormControl('', [Validators.required]),
max: new FormControl('', [Validators.required]) max: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, FormArray } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, UntypedFormArray } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, SelectMultipleCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, SelectMultipleCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -28,19 +28,19 @@ export class CheckboxComponent extends AbstractSearchTypeComponent { ...@@ -28,19 +28,19 @@ export class CheckboxComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl('') label: new UntypedFormControl('')
}); });
} }
setAttribute(attribute: Attribute): void { setAttribute(attribute: Attribute): void {
super.setAttribute(attribute); super.setAttribute(attribute);
// Initialization of checkboxes (1 per option) // Initialization of checkboxes (1 per option)
const formControls: FormControl[] = []; const formControls: UntypedFormControl[] = [];
for (let i = 0; i < attribute.options.length; i++) { for (let i = 0; i < attribute.options.length; i++) {
formControls.push(new FormControl()); formControls.push(new UntypedFormControl());
} }
this.form.addControl('checkboxes', new FormArray(formControls)); this.form.addControl('checkboxes', new UntypedFormArray(formControls));
} }
setCriterion(criterion: Criterion) { setCriterion(criterion: Criterion) {
...@@ -90,8 +90,8 @@ export class CheckboxComponent extends AbstractSearchTypeComponent { ...@@ -90,8 +90,8 @@ export class CheckboxComponent extends AbstractSearchTypeComponent {
* *
* @return FormArray * @return FormArray
*/ */
getCheckboxes(): FormArray { getCheckboxes(): UntypedFormArray {
return this.form.controls.checkboxes as FormArray; return this.form.controls.checkboxes as UntypedFormArray;
} }
/** /**
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils'; ...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils';
export class DatalistComponent extends AbstractSearchTypeComponent { export class DatalistComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
value: new FormControl('', [Validators.required]) value: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils'; ...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils';
export class DateComponent extends AbstractSearchTypeComponent { export class DateComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
date: new FormControl('', [Validators.required]) date: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -24,11 +24,11 @@ export class DateTimeComponent extends AbstractSearchTypeComponent { ...@@ -24,11 +24,11 @@ export class DateTimeComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
date: new FormControl('', [Validators.required]), date: new UntypedFormControl('', [Validators.required]),
hh: new FormControl('', [Validators.required]), hh: new UntypedFormControl('', [Validators.required]),
mm: new FormControl('', [Validators.required]) mm: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils'; ...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils';
export class FieldComponent extends AbstractSearchTypeComponent { export class FieldComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
value: new FormControl('', [Validators.required]) value: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, JsonCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, JsonCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -26,11 +26,11 @@ export class JsonComponent extends AbstractSearchTypeComponent { ...@@ -26,11 +26,11 @@ export class JsonComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl(''), label: new UntypedFormControl(''),
path: new FormControl('', [Validators.required]), path: new UntypedFormControl('', [Validators.required]),
operator: new FormControl('', [Validators.required]), operator: new UntypedFormControl('', [Validators.required]),
value: new FormControl('', [Validators.required]) value: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, ListCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, ListCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -26,9 +26,9 @@ export class ListComponent extends AbstractSearchTypeComponent { ...@@ -26,9 +26,9 @@ export class ListComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl(''), label: new UntypedFormControl(''),
list: new FormControl('', [Validators.required]) list: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils'; ...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils';
export class RadioComponent extends AbstractSearchTypeComponent { export class RadioComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
radio: new FormControl('', [Validators.required]) radio: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, SelectMultipleCriterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, SelectMultipleCriterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -26,9 +26,9 @@ export class SelectMultipleComponent extends AbstractSearchTypeComponent { ...@@ -26,9 +26,9 @@ export class SelectMultipleComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl(''), label: new UntypedFormControl(''),
select: new FormControl('', [Validators.required]) select: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils'; ...@@ -21,9 +21,9 @@ import { searchTypeOperators } from 'src/app/shared/utils';
export class SelectComponent extends AbstractSearchTypeComponent { export class SelectComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
select: new FormControl('', [Validators.required]) select: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component, ChangeDetectorRef } from '@angular/core'; import { Component, ChangeDetectorRef } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
...@@ -31,11 +31,11 @@ export class SvomJsonKwComponent extends AbstractSearchTypeComponent { ...@@ -31,11 +31,11 @@ export class SvomJsonKwComponent extends AbstractSearchTypeComponent {
constructor(private changeDetectorRef: ChangeDetectorRef, private http: HttpClient, private config: AppConfigService) { constructor(private changeDetectorRef: ChangeDetectorRef, private http: HttpClient, private config: AppConfigService) {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
label: new FormControl(''), label: new UntypedFormControl(''),
path: new FormControl('', [Validators.required]), path: new UntypedFormControl('', [Validators.required]),
operator: new FormControl('', [Validators.required]), operator: new UntypedFormControl('', [Validators.required]),
value: new FormControl('', [Validators.required]) value: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms'; import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms';
import { AbstractSearchTypeComponent } from './abstract-search-type.component'; import { AbstractSearchTypeComponent } from './abstract-search-type.component';
import { Criterion, FieldCriterion } from 'src/app/instance/store/models'; import { Criterion, FieldCriterion } from 'src/app/instance/store/models';
...@@ -24,10 +24,10 @@ export class TimeComponent extends AbstractSearchTypeComponent { ...@@ -24,10 +24,10 @@ export class TimeComponent extends AbstractSearchTypeComponent {
constructor() { constructor() {
super(); super();
this.form = new FormGroup({ this.form = new UntypedFormGroup({
operator: new FormControl(''), operator: new UntypedFormControl(''),
hh: new FormControl('', [Validators.required]), hh: new UntypedFormControl('', [Validators.required]),
mm: new FormControl('', [Validators.required]) mm: new UntypedFormControl('', [Validators.required])
}); });
} }
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<div class="row mt-3"> <div class="row mt-3">
<div class="col"> <div class="col">
Show Show
<select class="custom-select" (change)="changeNbItems($event.target.value)"> <select class="custom-select" (change)="changeNbItems($event)">
<option value="10" selected="true">10</option> <option value="10" selected="true">10</option>
<option *ngIf="dataLength > 10" value="20">20</option> <option *ngIf="dataLength > 10" value="20">20</option>
<option *ngIf="dataLength > 20" value="50">50</option> <option *ngIf="dataLength > 20" value="50">50</option>
......