1
我想實現一個功能,我將使用在編輯模式下使用Angular Formly創建的相同表單作爲文本字段,並在只讀模式的標籤,該標籤只顯示數據不是一個文本框Angular formly form用於編輯[輸入字段]和只讀[顯示字段在Extjs]
我想實現一個功能,我將使用在編輯模式下使用Angular Formly創建的相同表單作爲文本字段,並在只讀模式的標籤,該標籤只顯示數據不是一個文本框Angular formly form用於編輯[輸入字段]和只讀[顯示字段在Extjs]
我會做一個custom template這樣的(基於bootstrap templates):
formlyConfig.setType({
name: 'readonly',
extends: 'input',
wrapper: ['bootstrapLabel', 'bootstrapHasError'],
template: '<span class="my-readonly-field" ng-model="model[options.key]">',
});
見例如jsbin:http://jsbin.com/jevobil/1/edit?css,js,console,output
你想使用它們兩個不同的頁面?或者你希望發生這種情況,就像當你點擊一個鎖定文本的按鈕時寫入操作一樣? – Amarnath