AngularJS service.
File: lib/client/auto-formly.js
Parse Mongo.Collection to get array with fields
Arguments
- collection {CollectionCollection|AngularMeteorCollection}
Mongo Collection used directly or with $meteor AngularJS service
- options {array|object|undefined}
Optional filtering fields using array with collection's keys or options object.
- options.all {boolean}
Show all fields when true. Otherwise only these defined (see below)
- options.fields {object}
Object with the field's key as property and formly field configuration (extends the auto-generated configuration). Instead of using formly configuration you can set field as visible or not using boolean value (true visible, false not used)
Returns {Array}
Array with fields to use in formly-form.
Parse SimpleSchema object to get array with fields
Arguments
- schema {SimpleSchema}
SimpleSchema instance
- options {array|object|undefined}
See collection()
Returns {Array}
Array with fields to use in formly-form.
Gets errors of fields and sets them in form controls. Use it when insertion or collection update fails.
See example in readme.
Arguments
- collection {SimpleSchema}
SimpleSchema instance
- fields {array}
Array with fields