- ng g component form/create
- Add the following code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node -e ' | |
var config = require("dotenv").config(); | |
var packageJson = require("./package.json"); | |
console.log("docker run -itd \\"); | |
for (let i in config.parsed) { | |
switch (i) { | |
case "PDF_SERVER": | |
case "FORMIO_FILES_SERVER": | |
config.parsed[i] = config.parsed[i].replace("localhost", "pdf-server"); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jwt = require('jsonwebtoken'); | |
var token = jwt.sign({ | |
external: true, | |
form: { | |
_id: '59795d259be16e3ee58fddaa', | |
}, | |
project: { | |
_id: '59795d259be16e3ee58fdda6' | |
}, | |
user: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
for (let type in Formio.Components.components) { | |
var component = Formio.Components.components[type]; | |
component.editForm = function() { | |
return { | |
components: [ | |
{ | |
type: 'textfield', | |
label: 'Label', | |
key: 'label' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"label": "A", "key": "a"}, | |
{"label": "B", "key": "b"}, | |
{"label": "C", "key": "c"} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, AfterViewInit, ViewChild } from '@angular/core'; | |
import { FormioComponent, Formio } from '@formio/angular'; | |
@Component({ | |
template: ` | |
<formio src="https://examples.form.io/example"></formio> | |
<button (click)="submitFormio()" class="btn btn-primary">Submit</button> | |
` | |
}) | |
export class FormRenderComponent implements AfterViewInit { |
IMPORTANT NOTE: This no longer works. Please go to https://github.com/formio/contrib to learn the recommended way of creating Custom Components.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SelectBoxesComponent = Formio.Components.components.selectboxes; | |
function SelectImagesComponent(component, options, data) { | |
SelectBoxesComponent.prototype.constructor.call(this, component, options, data); | |
} | |
SelectImagesComponent.prototype = Object.create(SelectBoxesComponent.prototype); | |
SelectImagesComponent.prototype.constructor = SelectImagesComponent; | |
SelectImagesComponent.schema = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance.component.onSetItems = function(component, items) { | |
var employees = []; | |
for (var id in component.data) { | |
if ( | |
component.data[id] && | |
(id === 'employee1' || | |
id === 'employee2' || | |
id === 'employee3') | |
) { | |
employees.push(component.data[id].data.email); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
">=" : [ | |
{"reduce":[ | |
[ | |
{"if" : [{"var": "data.a"}, 1, 0]}, | |
{"if" : [{"var": "data.b"}, 1, 0]}, | |
{"if" : [{"var": "data.c"}, 1, 0]}, | |
{"if" : [{"var": "data.d"}, 1, 0]}, | |
{"if" : [{"var": "data.e"}, 1, 0]}, | |
{"if" : [{"var": "data.f"}, 1, 0]}, |