angular2-ngmodel

    2熱度

    1回答

    我對ng2和inputmask有一些問題。例如,我有過這樣的代碼 component.html <div class="form-group col-sm-7"> <label class="control-label" for="sender-phone">Phone *</label> <input type="text" [(ngModel)]="sender.phone

    4熱度

    3回答

    我想一個字符串數組從我的輸入綁定,所以在HTML文件中我寫了這一點: <div *ngFor="let word of words; let in=index" class="col-sm-3"> <div class="form-group"> <input type="text" [(ngModel)]="words[in]" class="form-control"

    6熱度

    3回答

    我有一個Angular 2應用程序正在處理客戶和春季休息後端。客戶對象有一個客戶類型,這也是一個對象,我有客戶表單上的下拉菜單,因此對象被存儲爲值,但我無法弄清楚如何選擇正確的客戶類型現有客戶被加載到表單中。 <select class="form-control" required [(ngModel)]="customer.customerType" > <option *ngFor

    2熱度

    2回答

    這是我的代碼: HTML: <div *ngFor="let reject of rejects, let i = index"> <h2>{{reject.reason}}</h2> <input type="text" [(ngModel)]="reject.reason" [ngFormControl]="inputField"> <rt-dropdown (s

    1熱度

    1回答

    我試圖用兩個子組件(Infos和Localisation)創建一個父組件(名爲Action),並將子項的輸入與父模型綁定。 這是模型 export class Action{ titre : string; localisation = new Localisation(); } export class Localisation{ region : strin

    9熱度

    5回答

    我有這樣的代碼在我的模板: <select [ngModel]="selectedSubSectionId" (ngModelChange)="onSubSectionChange($event)"> <option *ngFor="let subSection of event.subSections" [ngValue]="subSection.id">{{ subSection.n

    0熱度

    1回答

    我有一個HTML,看起來像這樣的選項中進行選擇: <select [(ngModel)]="role" (ngModelChange)="roleChanged($event)"> <option *ngFor="#role of roles" [ngValue]="role">{{role.Name}}</option> </select> 角色[]獲取分配一個訂閱從我服務的可觀

    0熱度

    1回答

    Angular2輸入文本值未顯示我的Angular2應用程序出現令人討厭的情況,我有一個包含多行的表,每行都包含使用[(ngModel)]進行雙向綁定的列。 我有2個按鈕的添加和刪除,他們推/拼接用於該表的值的列表。 將新項目推入列表或從列表中拼接(刪除)項目時 - 表格已更新。 唯一的錯誤是當我從列表中刪除一行(項目),然後添加一個新項目時,表格中的一行然後以某種方式顯示空值,當我在Chrome

    1熱度

    1回答

    我們決定只在Angular2應用程序的後端進行驗證。在這種情況下,它看起來像ng2的Forms,formBuilder,ngControls等等,它們的額外代碼並不是必需的,並且添加了很多代碼。除了驗證,它們有用嗎?我們知道我們的應用程序的上下文,並知道服務器端驗證的優點和缺點,我想知道,我們會後悔嗎?不使用NG2的形式在這種情況下?他們是否有其他有用的或重要的功能?)

    1熱度

    3回答

    我試圖在Angular2中使用ngModel實現內聯編輯。我有一個數組需要使用ngFor迭代,也使用ngModel。當我嘗試對該數組應用內嵌編輯時,我只能編輯每個數組變量的一個字符。 你可以找到一個工作示例here。 這裏有一個地方我使用ngModel和ngFor合的部件代碼: import {Component} from '@angular/core' import {InlineEditC