
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
angular-formly-transformer
Advanced tools
Better way of field transformation in Angular-Formly.
meteor add wieldo:angular-formly-transformer
npm install angular-formly-transformer
bower install angular-formly-transformer
angular.module('myApp', [
'formly',
'formlyTransformer'
])
Each transformer has four arguments: fields, model, formOptions, and form.
See fieldTransform in formlyConfig for details.
Transformer is basically the same as fieldTransform method. formlyTransform service just wraps all functions into one place.
formlyTransformer.register(function(fields, model, form, formOptions) {
// ...
});
formlyTransformer creates property with "transformers" key and empty object as value.
Special space is removed after all the transformers are executed.
So basically, you can put there all your transformation methods which are based on custom property.
angular.module('myAppName', [
'formly',
'formlyTransformer'
])
.run(runApp)
.controller('demoCtrl', demoCtrl);
function runApp(formlyTransformer) {
// label upperCaseLabel transformer
formlyTransformer.register(function(fields) {
fields.forEach((field) => {
if(field.transformers.upperCaseLabel && field.templateOptions && field.templateOptions.label) {
field.templateOptions.label = field.templateOptions.label.toUpperCase();
}
});
});
}
function demoCtrl(formlyTransformer) {
var vm = this;
vm.fields = [
key: 'firstName',
type: 'input',
templateOptions: {
label: 'First name'
},
transformers: {
upperCaseLabel: true
}
];
console.log(vm.fields[0].templateOptions.label); // FIRST NAME
}
[1.3.0] - 2016-01-18
FAQs
Automate configuration of fields in Angular-Formly
The npm package angular-formly-transformer receives a total of 2 weekly downloads. As such, angular-formly-transformer popularity was classified as not popular.
We found that angular-formly-transformer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.