當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FormArray.removeAt方法代碼示例

本文整理匯總了TypeScript中@angular/forms.FormArray.removeAt方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormArray.removeAt方法的具體用法?TypeScript FormArray.removeAt怎麽用?TypeScript FormArray.removeAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/forms.FormArray的用法示例。


在下文中一共展示了FormArray.removeAt方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

      it('should support removing', () => {
        a.push(c1);
        a.push(c2);
        a.push(c3);

        a.removeAt(1);

        expect(a.controls).toEqual([c1, c3]);
      });
開發者ID:manekinekko,項目名稱:angular,代碼行數:9,代碼來源:form_array_spec.ts

示例2: inject

         inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
           a.valueChanges.subscribe({
             next: (value: any) => {
               expect(value).toEqual(['old1']);
               async.done();
             }
           });

           a.removeAt(1);
         }));
開發者ID:manekinekko,項目名稱:angular,代碼行數:10,代碼來源:form_array_spec.ts

示例3: adaptFormArraySize

export function adaptFormArraySize(formArray: FormArray, size: number, elementProducer: (index: number) => AbstractControl) {

    while (formArray.length !== size) {
        if (formArray.length > size) {
            formArray.removeAt(0);
        } else if (formArray.length < size) {
            formArray.push(elementProducer(formArray.length));
        }
    }
}
開發者ID:hmenager,項目名稱:composer,代碼行數:10,代碼來源:form-array-helpers.ts

示例4: removeFormArrayGroup

    removeFormArrayGroup(index: number, formArray: FormArray, formArrayModel: DynamicFormArrayModel): void {

        formArray.removeAt(index);
        formArrayModel.removeGroup(index);
    }
開發者ID:thanhdevapp,項目名稱:ng-dynamic-forms,代碼行數:5,代碼來源:dynamic-form.service.ts

示例5:

 this.children.forEach((child, index) => {
     if (index >= valLen) {
         this.model.removeAt(index)
     }
 })
開發者ID:zodiac-team,項目名稱:zodiac-ui,代碼行數:5,代碼來源:nodes.ts

示例6: deleteFormArray

 deleteFormArray(i) {
   this.parentFormArray.removeAt(i);
 }
開發者ID:PnEcrins,項目名稱:GeoNature,代碼行數:3,代碼來源:actors.component.ts

示例7: removeFromCollection

	// ---
	// PRIVATE METHODS.
	// ---

	// I remove the given control from the given array. Mutates the array.
	private removeFromCollection( collection: FormArray, item: FormControl ) : void {

		collection.removeAt( collection.controls.indexOf( item ) );

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:10,代碼來源:reactive-form.component.ts

示例8: remove

 public remove(index: number) {
     this.collection.splice(index, 1);
     this.collectionForms.removeAt(index);
 }
開發者ID:PjMitchell,項目名稱:ConfigServer,代碼行數:4,代碼來源:string-collection-input.component.ts

示例9: loeschen

 loeschen(index: number) {
     this.positionen.removeAt(index);
 }
開發者ID:haschi,項目名稱:dominium,代碼行數:3,代碼來源:gruppe.component.ts

示例10: remove

 public remove(item: any) {
     const index = this.collection.indexOf(item);
     this.collection.splice(index, 1);
     this.collectionForms.removeAt(index);
 }
開發者ID:PjMitchell,項目名稱:ConfigServer,代碼行數:5,代碼來源:collection-input.component.ts


注:本文中的@angular/forms.FormArray.removeAt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。