Comments (7)
I'm willing to work on this chore, but I'm not sure how to proceed, as there's no updated docs regarding it. Would this be correct?:
Example: src/types/checkbox.js
export default ngModule => {
ngModule.config(addCheckboxType);
function addCheckboxType(formlyConfigProvider, formlyBootstrapApiCheck) {
const c = formlyBootstrapApiCheck;
formlyConfigProvider.setType({
name: 'checkbox',
template: require('./checkbox.html'),
wrapper: ['bootstrapHasError'],
apiCheck: function() {
return: {
templateOptions: c.shape({
label: c.string
})
};
},
apiCheckInstance: c
});
}
};
from angular-formly-templates-bootstrap.
Yes, totally forgot to update this. You almost have it. The only difference is you no longer need to specify that templateOptions
is a shape because that is assumed. So it'd look more like this:
{
apiCheck(check) {
return {
templateOptions: {label: check.string}
};
}
}
from angular-formly-templates-bootstrap.
Good, gonna make a PR asap
from angular-formly-templates-bootstrap.
Remember, this is built with es6 :-) So you could go crazy and do this:
apiCheck: check => ({templateOptions: {label: check.string}})
but that may be pushing it a bit ;-)
from angular-formly-templates-bootstrap.
Note, this will technically be a breaking change because this new format isn't supported by older versions of angular-formly and we'll have to update the peerDep to be: >=6.20.0
. Therefore, this will push angular-formly-templates-bootstrap to 6.0.0
. Not bad, just wanna follow semver :-)
from angular-formly-templates-bootstrap.
Don't you worry about doing that for your PR though. I'll take care of that.
from angular-formly-templates-bootstrap.
Released as 6.0.0
! Thanks~
from angular-formly-templates-bootstrap.
Related Issues (20)
- Radio elements disabled HOT 1
- Trying to contribute - build error on npm install HOT 2
- Dinamically generates fields
- Support for custom interpolation symbols
- Formly radio button and checkbox looks empty even on selection HOT 2
- apiCheck warnings when using an object for select options
- addOnRight/addOnLeft onClick functions not working properly
- Bootstrap 4 HOT 1
- New type extends 'select' setting error HOT 1
- "Argument 'module' is not a function, got Object" when inject module dependencies
- multiCheckbox with a key in a nested json model does not work HOT 6
- Not compatible with horizontal forms HOT 1
- Disable particular radio options HOT 1
- Multicheckbow is not working with JSON objects
- Don't have dist in 6.3.1 version HOT 1
- Radio option description
- data-placeholder attribute is missing from select type. HOT 6
- Set error and 'has-error' after form submitting.
- Select field is not working
- Cannot read property '$setTouched' of undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-formly-templates-bootstrap.