GithubHelp home page GithubHelp logo

Comments (7)

benoror avatar benoror commented on August 28, 2024

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.

kentcdodds avatar kentcdodds commented on August 28, 2024

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.

benoror avatar benoror commented on August 28, 2024

Good, gonna make a PR asap

from angular-formly-templates-bootstrap.

kentcdodds avatar kentcdodds commented on August 28, 2024

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.

kentcdodds avatar kentcdodds commented on August 28, 2024

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.

kentcdodds avatar kentcdodds commented on August 28, 2024

Don't you worry about doing that for your PR though. I'll take care of that.

from angular-formly-templates-bootstrap.

kentcdodds avatar kentcdodds commented on August 28, 2024

Released as 6.0.0! Thanks~

from angular-formly-templates-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.