AngularJS directive which takes JSON representing a form and renders to HTML
Error: [ng:cpws] Can't copy! Making copies of Window or Scope instances is not supported. http://errors.angularjs.org/1.6.3/ng/cpws
in order to use angular-formly with angularjs 1.7.8 (it was a pentest requirement to use the latest version of angularjs) . What I did is to replace the function reverseDeepMerge(dest)
. So far it seems to have solved it. function reverseDeepMerge(dest) {
_angularFix2['default'].forEach(arguments, function (src, index) {
if (!index) {
return;
}
_angularFix2['default'].forEach(src, function (val, prop) {
if (!_angularFix2['default'].isDefined(dest[prop])) {
//dest[prop] = _angularFix2['default'].copy(val);
if(typeof val === 'object' && val!==null){
dest[prop] = Object.assign(Object.create(val.__proto__),val);
}else{
dest[prop] = val;
}
} else if (objAndSameType(dest[prop], val)) {
reverseDeepMerge(dest[prop], val);
}
});
});
return dest;
}
FormlyFieldConfig
type, with a fieldGroup
field {key: "myfile", type: "file"}
however if I log my form model I can't see a myfile
key within returned json. What's wrong with my code??
Hi, can we populate the input field with the help of login api, suppose I login and come to formly form and username, email should be filled with the help of API here
Any comments?
Hi All,
Below is my code. Could please someone help me, how min and max values update dynamically to Age field when user change the value from select box is numeric field in angular-formly ?
fields: FormlyFieldConfig[] = [
{
id: 'numbers',
key: 'numeric',
type: 'select',
className: 'p-inputtext-lg',
templateOptions: {
label: 'Number Type',
valueProp: 'value',
labelProp: 'label',
options: [{
value: 'one',
label: 'One'
}, {
value: 'two',
label: 'Two'
}],
required: true,
onChange: '',
},
expressionProperties: {
'templateOptions.onChange': $viewValue => {
},
},
}, {
id: 'age',
name: 'age',
type: 'input',
className: 'p-inputtext-lg',
templateOptions: {
label: 'Age',
required: true,
min: 1,
max: 18
}
}
]
Thanks in advance.