GithubHelp home page GithubHelp logo

Comments (3)

bshivam1 avatar bshivam1 commented on May 19, 2024 1

Done !
module.exports = function(app) {
app.config([
'formioComponentsProvider',
function(formioComponentsProvider) {
formioComponentsProvider.addGroup('GroupName',{
title: 'GroupTitle'

    })
    console.log(formioComponentsProvider);
    var isNumeric = function isNumeric(n) {
      return !isNaN(parseFloat(n)) && isFinite(n);
    };
    formioComponentsProvider.register('ComponentName', {
      title: 'ComponentTitle',

//Define template link here
template: 'formio/components/component.html',
settings: {

      },
      group: 'GroupName',
      controller: ['$scope', function($scope) {
      
      }]
    });
  }
]);

from ngformbuilder.

Morshed0308 avatar Morshed0308 commented on May 19, 2024 1

Hello @virajkanwade ,
You can first config your formiocomponents like this
app.config(['formioComponentsProvider', function (formioComponentsProvider) {

and then you can add your group and title like below:

formioComponentsProvider.addGroup('Group Name', { title: 'Group Title' });

after that you can register your custom component using the same group name inside this

formioComponentsProvider.register('componentName',{
});
    

For example a simple custom component will look like this :

app.config(['formioComponentsProvider', function (formioComponentsProvider) {
 
    formioComponentsProvider.addGroup('amazing', { title: 'Custom Template Components' });

formioComponentsProvider.register('reCAPTCHA', {
        title: 'reCAPTCHA',
        template: 'The URL where the component will load',
        controller: ['$scope', function ($scope) {
        
        }],
        group: 'amazing',
        icon: 'fa fa-refresh',  
      ////Here you can add your own json scema for this component///////////

    });

}]);

You can add this in a new file and add the script src where the main page is loaded.

<script src="/FolderName/Scripts/Customcomponent.js" type="text/javascript"></script>

Hope this helps.

from ngformbuilder.

virajkanwade avatar virajkanwade commented on May 19, 2024

Can you please provide more details? Where to write this code? how to call the function?

Thanks

from ngformbuilder.

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.