Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Ionic 3 - Register new element is formBuilder

I have added a custom slider element in the formBuilder. The code is as below:

var fields = [{
    label: 'Rating',
    attrs: {
      type: 'slider'
    },
    icon: '๐ŸŒŸ'
  }];

  var templates = {
    slider: function(fieldData) {
      return {
        field: '<input type="range" min="0" max="10">'
      }
    }
  };

  $(container).formBuilder({
    templates,
    fields
  });

The JSON data it generates is as below:

[
  {
    "type": "slider",
    "required": false,
    "label": "Rating",
    "name": "slider-1643115075076-0",
    "access": false
  }
]

But when I pass this data to formRender method on my app I am getting the following error:

Error: Invalid control type. (Type: slider, Subtype: undefined). Please ensure you have registered it, and imported it correctly.

How do I register this new element such that it appears on my app?

about 4 years ago ยท Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!