Giter VIP home page Giter VIP logo

forms-angular's Introduction

forms-angular

Probably the most opinionated framework in the world

Gitter

Build Status Dependency Status Downloads

See the documentation at http://www.forms-angular.org

Installation of forms-angular

Recommended: use yeoman generator.

Alternative: you can install both front-end and back-end modules:

npm install --save forms-angular
bower install --save forms-angular

Security Disclosure

Security is very important to us. If discover any issue regarding security, please disclose the information responsibly by sending an email to [email protected] and not by creating a github issue.

For developers of forms-angular

npm install -g tsd
tsd update -so

Prepare a new release:

gulp all

forms-angular's People

Contributors

antoinepairet avatar cupofnestor avatar dependabot[bot] avatar derekdomino avatar dominicboettger avatar gitter-badger avatar igblip avatar ltullman avatar ludeck avatar mchapman avatar me97esn avatar sjclemmy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forms-angular's Issues

How to modify "list form" template for every model?

image

I want to change only first column has a link to edit, but others column is painted as normal label.

In second columns, that is a column with type String and use editor: 'ckEditor'.

My test models is :

'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var ProductCategorySchema = new Schema({
Name: {
type: String,
required: true,
index: true,
list:true,
form: {label: 'Product Category'}
},
Description: {
type: String,
list:true,
form: {
type: 'textarea',
editor: 'ckEditor',
label: 'Description'
}
},
ParentCategory: {
type: Schema.Types.ObjectId,
ref: 'ProductCategory',
list:true,
form: {
label: 'Parent Category',
help: 'For root category, leave this field blank!'
}
},
Status: {
type: Boolean,
default: true,
list:true,
},
CreatedAt: {
type: Date,
readonly: true,
default: Date.now,
form: {hidden: true}
}
});

var ProductCategory = mongoose.model('ProductCategory', ProductCategorySchema);

module.exports = ProductCategory;

This is my test of your great project for today.

Thanks in advance

Array of docs with subdoc: cannot enter values in field input

It is not possible to set values via the front-end for a Schema that includes a array of a SubSchema and this SubSchema defines properties as again a sub-doc.

var SubSchema = new Schema({
    // ...
    mention: {type: Schema.Types.ObjectId, ref: 'mention'},
    grades: {
           low: Number,
           high: Number
   }
});

var GreatSchema = new Schema({
    // ...
    mentions: {type: [SubSchema]}
});

At the front-end level, the edit view of this model does not pre-fill the 'grade.low' and 'grade.high' input fields. Moreover, it is not possible to set values for them.

When trying to set a value in them, there's an error at the console level:

TypeError: Cannot set property 'low' of undefined

Inspecting the DOM reveals the problem:

<input ng-model="record.mentions.grades[$index].low" name="mentions-grades-low"  ... >

The [] operator is mis-placed. It should act on mentions instead of grades. E.g., the non-subdoc mention properties is correctly pre-filled:

<input ng-model="record.mentions[$index].mention" name="mentions-mention"  ... >

Could you provide me with some hints for starting a tentative fix?

How to use server rendered Mongoose schema to generate a form?

Hello Mark,

I have a question about how can I use the forms-angular in my own project.

I have read the doc of forms-angular and have a look at the source code of this project. You did a great job on making a full framework, but we have our own server with some custom logic which use mongoose schema as well. So far, forms-angular framework seems difficult to be used in both server and client side just like a module or dependency. Of course, it should be a framework.

However, I found only your solution is the best one to generate a form based on mongoose schema. So how should I use your work as a module.

More in detail, our server has mongoose schema for data which can also be retrieved by API. I wanna the angular app read mongoose schemas and generate forms from that.
Could you give me some hints about how can I modify the baseCtrl of your angular app to make this possible.

Best regards,
Kevin

Build settings

Hello Mark,

i hope you can help me and tell me something about your build infrastructure.
Just wan to create some test builds and the grunt testprep - task always fails, caused by missing components.

Running "concurrent:dist" (concurrent) task
Warning: Running "recess:dist" (recess) task
>> '../../bower_components/components-font-awesome/less/variables.less' wasn't found.
Warning: Use --force to continue.

Do you have a bower.json for the ../../bower_components directory?
Are you executing your grunt testprep from another directory?

Thanks for your help!

Best regards
Dominic

Single file upload

Hi, I really like your project!
I have few questions:

  1. how can I limit the number of file uploaded?
  2. what's the best way to have a single file upload input field instead of a multi upload input field?

Development snapshot

Hello,

what is your preferred way to use the latest dev snapshot for your development?
Do you checkout the dev branch and do a grunt build and then copy the sources to the correct destinations?

Thanks a lot for your help!

Best regards
Dominic

Bootstrap3 compatibility

Hello,

i did some changes in my repository.
First i removed the whole angular-forms.css (from my html). Then i renamed all icon- classes into glyphicon glyphicon- classes.
Now my version supports bootstrap 3. Still some minor issues with subfields, but i will add a bootrap3 compatible css without the whole bootstrap code soon.

Is that a wanted feature or should angular-forms on bootstrap 2?

Best regards
Dominic

'Bower install forms-angular' results in version conflicts

bower install forms-angular
(...)
Unable to find a suitable version for angular, please choose one:
    1) angular#>=1.0.2 which resolved to 1.2.20 and is required by angular-ui-select2#0.0.4 
    2) angular#~1.x which resolved to 1.2.20 and is required by angular-ui-date#48c68507be 
    3) angular#>=1.0.6 which resolved to 1.2.20 and is required by angular-elastic#2.3.5 
    4) angular#>=1 which resolved to 1.2.20 and is required by angular-ui-bootstrap-bower#0.8.0 
    5) angular#~1.2.9 which resolved to 1.2.20 and is required by ng-ckeditor#0.2.1 
    6) angular#1.3.0-beta.8 which resolved to 1.3.0-beta.8 and is required by angular-mocks#1.3.0-beta.8, angular-route#1.3.0-beta.8, angular-sanitize#1.3.0-beta.8, forms-angular#0.3.5

Prefix the choice with ! to persist it to bower.json

[?] Answer:

Cannot read or save array of ObjectId's

When defining model with a simple array of references, like:

var mySchema = new Schema({
    components: {
        type: [Schema.Types.ObjectId],
        ref: 'Component',
        form: {
            select2: {
                fngAjax: true
            }
        }
});
  1. the labels of the stored references are not displayed (the input fields are left empty when reading an existing document)
  2. when adding with forms-angular a new entry in the array (clicking the + button), the search works but then Mongoose rejects the document that forms-angular wants to save

Problem 1 originates in the fact that the array for the input field is not processed
from [id1, id2] to ย [{x: id1, text: 'hello'}, {x: id2, text:'ola'} ... ]

I've been able to track the issue up to the following line where $scope.f_component_ids is undefined:
https://github.com/forms-angular/forms-angular/blob/master/js/controllers/base.js#L1096

Then I don't know where/how those f_xxx_ids should be created.

Could you provide me with some info about the next steps?

Other arrays work very well (like an array of String or an array of Schema()).

Get started on Web site http://www.forms-angular.org/#/get-started

seems to be missing some sections - you refer to details throughout your web site that is not present in the Get Started section?

I especially miss guidance and example code on the AngularJs end - that is getting from the Mongoose schema to what ever needs to get setup in angular to make the conversion to the html.

Thanks and best regards

Provide example (like Applicants)

I'm trying to set up a basic app but I'm a little confused on the exact workflow to follow (I just switched to javascript/angular from Django so please excuse my inexperience). I've gotten the starter app set up using the Yeoman constructor you made but I can't seem to figure which of the fng:endpoint/route/etc I need to use to set something up like your example forms or Applicants.

Can you provide a basic example of how to create something like Applicant?

Thanks!

Form in mobile?

image

CRUD button in desktop mode is OK, but I test in mobile using Ripple emulator, first line buttons is hidden.

How to change it?

I change in ../template/form-button-bs2.html and ../template/form-button-bs3.html, but the result is same.

Thanks

Using without Mongoose

I'was looking for a form generator based on JSON Schema for Angular.
It's possible to use your code without Mongoose?

My backend is a Symfony+Doctrine one, I want to privide schemas from Symfony and use forms-angular for form generation and handling, but then use Symfony again for CRUD.

Can you give me some advices about?

TypeError: Cannot read property 'paths' of undefined.

This line of code throws the error:

DataFormHandler.addResource('user', UserModel);

Here is my code of index.js controller of a Kraken.js application:

'use strict';


var IndexModel = require('../models/index');
var UserModel = require('../models/user');
var formsAngular = require('forms-angular');



module.exports = function (router) {

    // var model = new IndexModel();
    var user = new UserModel();


    router.get('/', function (req, res) {

        var DataFormHandler = new (formsAngular)(req.app);
        DataFormHandler.addResource('user', UserModel);

        var model = {
            hello: "Hello"
        }

        res.render('index', model);
    });

};

And DataFormHandler.addResource('user', UserModel); throws a TypeError error when I do page reload:

Internal server error
The URL / had the following error TypeError: Cannot read property 'paths' of undefined.

The error disappears when I comment the line. So it is obvious that that line throws the error.

What causes the error? How to fix it?

example instructions fail

I'll preface this with saying I know nothing about any of the tech you're using here.

That said, I followed the instructions both for the minimal site and the "do it yourself" example and both had the same result.

Everything looks like its up and running. The node log doesn't cite any missing files. (I did have to soft link "component" in the manual example). Mongo reports the repositories being made. But when I navigate to the site, I can't really do anything. The {{}} insertions are not filled in (angular?). It still says {{contextmenu}}. The API paths don't go anywhere.

I'm not really sure what the example is supposed to do, so can't give much better description than that. Would try to debug but like I said still learning. Hope this helps.

Error when install latest version

I got message :

1608 error Error: version not found: [email protected]
1608 error at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache\add-named.js:125:12
1608 error at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)
1608 error at Object.oncomplete (fs.js:107:15)
1609 error If you need help, you may report this entire log,
1609 error including the npm and node versions, at:
1609 error http://github.com/npm/npm/issues
1610 error System Windows_NT 6.2.9200
1611 error command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
1612 error cwd D:\nodejs-project\angular

Thanks

Displaying labels for radio boxes instead of values

I would like to implement the display of labels instead of values in radio boxes and would like to discuss about the best way to declare such labels in the forms-angular/mongoose model.

Currently a group of radio boxes can created with the following declaration:

myRadio: {
    type: String,
    enum: ['choice1', 'choice2'],
    form: {
        type: 'radio'
    }
}

According to mongoose documentation and source code, the enum property can be an object with a required 'values' entry. It seems we can add custom properties to this object.

Proposition:

myRadio: {
    type: String,
    enum: {
        values: ['choice1', 'choice2'],
        labels: ['Pizza', 'Lamb stew']
    }
    form: {
        type: 'radio'
    }
}

Label aignment

Awesome piece os software. However, I noticed that whenever I set the model (eg. below), the labels alignment changes from being aligned right to being aligned left.

<form-input model="xyz"

core pieces?

I am looking for a solution to dynamically build a form: create a schema -> display a form.
Your implementation looks promising! But as far as I understand, I would only require a small portion of your code. Could you help me to find the core pieces (with dependencies) in the forms-angular project?
Thanks,
Nicolas

using columnTranslations with two refs.

when using two columnTranslations refs like:
columnTranslations: [
{
field: 'User',
ref: 'User'
},
{
field: 'Business',
ref: 'Business'
}
]

you'll get only the "user" due to closure problem in code:
this is the fix:

if (!toDo[thisColumnTranslation.ref]) {

              var getFunc = function(ref) {
                  var lookup = ref;
                  return function (cb) {
                      var translateObject = {ref: lookup.resourceName, translations: [] };
                      translations.push(translateObject);
                      lookup.model.find({}, {}, {lean: true}, function (err, findResults) {
                          if (err) {
                              cb(err);
                          } else {
                              for (var j = 0; j < findResults.length; j++) {
                                  translateObject.translations[j] = {value: findResults[j]._id, display: self.getListFields(lookup, findResults[j])};
                              }
                              cb(null, null);
                          }
                      });
                  };
              }
              toDo[thisColumnTranslation.ref] = getFunc(lookup);

just wrap it with function so each one will have its own "lookup"

Install errors

Hi, when doing a new standard install with: "yo fng" it installs and works but i get the error meassages below, can you help me out on what it means and if i should care? Kind regards

From the npm-debug.log:

121821 error EEXIST, mkdir 'D:\Dropbox\n2\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\download'
File exists: D:\Dropbox\n2\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\download
Move it away, and try again.
121822 error System Windows_NT 6.2.9200
121823 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
121824 error cwd D:\Dropbox\n2
121825 error node -v v0.10.30
121826 error npm -v 1.4.21
121827 error path D:\Dropbox\n2\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\download
121828 error fstream_path D:\Dropbox\n2\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modules\pngquant-bin\node_modules\bin-wrapper\node_modules\download\index.js
121829 error fstream_type File
121830 error fstream_class FileWriter
121831 error code EEXIST
121832 error errno 47
121833 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:171:23
121833 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:37:53
121833 error fstream_stack Object.oncomplete (fs.js:107:15)
121834 verbose exit [ 47, true ]

Remembering value of reference fields in subdoc or nested schema

Hello,

Let's have the following model:

var GreatSchema = new Schema({
    // ...
    grade: {
        mention: {type: Schema.Types.ObjectId, ref: 'mention'},
        comment: String
   }

});

or

var SubSchema = new Schema({
    // ...
    mention: {type: Schema.Types.ObjectId, ref: 'mention'}
   }

var GreatSchema = new Schema({
    // ...
    mentions: {type: [SubSchema]}
});

Then, at the client level, when reloading an existing item the dropdown menus/comboboxes are not preselected with the recorded values.

The values are correctly saved. When reloading the item, values of the mention field of the subdocument are not preselected, the dropdown is left empty.

Fantastic framework - THX!!! Question: Role based access control

Thanks for an very impressive and very useful framework. And huge complement for the quality and rubutsness of the implementation - way above many other MEAN implmentations.

Question: Do you have some recommendations/pointers to how you would implement role based access control on the data (i can do done i so many different ways - but wanted to pick your brains before diving into the challange)

All the best !

Cannot reset a reference field with select2/fngAjax

Define in a model a reference field input with the select2/fngAjax display options

component: {
        type: Schema.Types.ObjectId,
        ref: 'Component',
        form: {
            select2: {
                fngAjax: true
            },
        }

At the front-end level, create a new document related to this model. Select a value for the reference field. Save. Reload the document.

Then, try to reset/empty the field: impossible. Once this field is set to a value, it is not possible to reset it.

generator-fng: grunt serve error on Windows

When executing grunt serve I got error :
D:\nodejs-project\forms-angular>grunt serve
Running "serve" task

Running "clean:server" (clean) task

Running "env:all" (env) task

Running "concurrent:server" (concurrent) task

Running "injector:scripts" (injector) task
Missing option template, using dest as template instead
Injecting js files (13 files)

Running "injector:css" (injector) task
Missing option template, using dest as template instead
Injecting css files (4 files)

Running "wiredep:target" (wiredep) task
Cannot find where you keep your Bower packages.

What's wrong in my step?

BTW, you use MongoDB as db storage, is it possible to use SQL db such as MySQL, etc in the future?

Thanks

Auto create API from form model

After read some documentation and FNG structure, I get conclusion :

How to build API from form model automatically?

My goal is create once code for web (currently model is OK but should run client/server in NodeJS server), mobile app, desktop app using PhoneGap/Cordova/Node-Webkit.

We need new variable to set host of REST API (server) and include it in "service" folder at client app, this variable set to blank when in development process (because REST is from some host/server), but if "build" process this variable should change to REST API server. In local server we can set to localhost:9000

The advantages of this scenario are :

  • We can build FNG as server app or server website like current state.
  • We can separate "client" app only to others conventional server like Apache/NginK, etc and get REST API from FNG server app
  • We can create client app only for Mobile using PhoneGap/Cordova use only client build from same code
    W- e can create client app only for desktop using Node-Webkit and get data from REST API FNG (it can be done using phonegap too in new version to port app to windows 8, ubuntu, and MacOSX only)

Thanks in advance

Default value for Boolean

Hi,

The default value of a boolean is not reflected at the client level when creating a new item.

For example, let's say we have defined the following active field:

var GreatSchema = new Schema({
    // ...
    active: {type: Boolean, default: true, index: true}
});

Then the checkbox for the boolean is unfortunately left unchecked:

<input ng-model="record.active" id="f_active" name="f_active" type="checkbox" class="ng-pristine ng-valid">

Feature: Content type / editor select field

Hi,

i attached the scribble of a feature i am currently thinking about. What do you guys think about that feature and what do you think how it can be mapped in the data model.

wysiwyg - mode

A possibility could be to add a structure like that for a textArea

body: {
text: {type: String, form: {type: }}
options: {type: String, enum: [plain, wysiwyg, markdown]}
}

What do you think about this feature and possible implementations?

Best regards
Dominic

Array Notation

I think attributes like hidden and secure don't work with array notation:

comments:[ { type: Schema.Types.ObjectId, ref: 'Comment', form: {hidden: true}} ],

But do work with

comments:{ type: [Schema.Types.ObjectId], ref: 'Comment', form: {hidden: true}},

new erros with todays release

Error: Unknown provider: $dialogProvider <- $dialog
at Error ()
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:29:195
at Object.c as get
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:29:280
at c (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:26:479)
at d (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:27:111)
at Object.instantiate (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:28:257)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:52:239
at <error: illegal access>
at Object.e.$broadcast (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:90:240) angular.min.js:62
Error: Multiple directives [ngTransclude, ngTransclude] asking for 'ngTransclude' controller on:


at Error ()
at ua (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:48:432)
at J (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:44:297)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:47:497
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:94:186
at h (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:77:437)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:78:169
at Object.e.$eval (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:88:272)
at Object.e.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:86:126)
at Object.e.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:88:431) angular.min.js:62
Error: Circular dependency:
at Error ()
at c (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:26:380)
at d (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:27:111)
at Object.instantiate (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:28:257)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:52:239
at <error: illegal access>
at Object.e.$broadcast (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:90:240)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:82:191
at h (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:77:437)
at h (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js:77:437) angular.min.js:62

Ckeditor

In a field defined as ckEditor - field the content does only load after doing a page reload.
If i select a element from the list the form will render, but the content of the editor field is missing. ckEditor seems to overwrite it at that moment. When reloading the entire page via browser reload button the content gets loaded into the body of ckEditor.

Do you have similar problems?

edit: Only happens when using the back button. A full reload always restores the functionality. Even when doing a manual reload on the list page the editor loads the correct data.

Select2 jwt Auth

When I add the following to models (like server/forms-angular-models/applicant.js in this example)

var ApplicantSchema = new Schema({
  ...
  parent: {type: Schema.Types.ObjectId, ref: 'Applicant', form: {select2: {fngAjax: true}, label: 'Parent'}},
  ...
});

I get UnauthorizedError: No Authorization header was found
I've checked the auth works on other pages, it happens right when you type 2 characters in the search and it queries GET /api/search/Applicant?q=Ad&pageLimit=10&page=1&_=1434391900640
I think it might have something to do with the injection order bc if I add

  if(req.cookies && req.cookies.token){
    req.headers.authorization = 'Bearer ' + req.cookies.token.replace(/\"/g,''); 
                        // because the cookie token contains extra dblquotes

  }

to server/auth/auth.service.js to parse the token from the cookie the searches work.

It happens with the default yo fng app
Would this be an actual issue, or does it seem like I'm just doing the authentication wrong?

using select2 fngajax with array of ref doesnt work.

Category: {
type: [Schema.Types.ObjectId],
ref: 'Category',
form: {
label: "Category",
select2: {fngAjax: true}
}
},

in the view we can see a list of selects each one works fine.
when we post the object we have some issue due to how select2 saves it
(the thing with the x:{ id: , text: })

the main issue was to parse the data from the server and convert id to text for a list of select2.

thanks.

select2 fngajax

when searching for some property, we got in reply as result not just the index props
also the second property.
example:
var City = new Schema({
Title: {
type: String,
index: true,
form:{
label:'City',
size:'large'
}
},

CreateTime: {
    type: Date,
    form:  {
        hidden: true
    },
    default: Date.now
},

and i i'll search using the api thru city.
i'll get in return:
"Cityname 2014-06-26 15:29:26.259Z"
instead of just "Cityname".

code issue:
data_form.js
line 59

for (; listElement < 2; listElement++) {
  display += doc[listFields[listElement]] + ' ';
}

should be 1.

Label for parent field

Do you know any way to add a label to a parent field and indent the subfields?

parent1: {
subfield1: { type: String},
subfield2: { type: String}
},
parent2: { type: String }

I want a label for parent1... :-(

Letter case of collection name when referencing a collection

When defining a Mongoose model that refers to another model, the model name should be spelled with the same letter cases.

It seems that Forms-Angular expects the model name to be lower-cased in the 'ref' property of field in the Schema. While Mongoose expects to have the same letter case as the registered name.

Example:

var BookSchema = new Schema({
    name: String
});
// Register model with an upper-case first letter
mongoose.model('Book', BookSchema);

// Now define a schema describing a list of books
var ShelfSchema = new Schema({
    booklist : [{type: ObjectId, ref: 'Book'}]
});
mongoose.model('Shelf', ShelfSchema);

In order to have forms-angular UI to display correctly the list of book when showing a shelf, we need to define ShelfSchema with ref: 'book'.
While in order to be able to perform a Mongoose's Shelf.find().populate('booklist') we need to define ShelfSchema with ref: 'Book'.

At this level forms-angular seems then to be incompatible with Mongoose.

Compare the 'ref' of forms-angular example
http://www.forms-angular.org/code/e_referencing_another_collection.js
with examples of Mongoose:
http://mongoosejs.com/docs/populate.html

deep nesting

hi deep nesting is not working.

even on your demo page deep nesting doesnt work -- check education / teachers it creates the + for teachers but no input fields

relative paths

Hello Mark,

i found an issue when creating the angular forms interface in a subpath of my application like /admin.
Every path in the js files seems to be relative.
So the application tries to find/admin/api/schema/myschema. I did not find a way to manipulate that. So that my interface always connects to /api/schema/myschema ignoring the current subpath.
Or do you have any plans to register multiple api's under different subpaths?

Thank you.

Best regards
Dominic

file and/or image uploads?

I'm probably just not finding it but how would I add a file/image upload field? Awesome project by the way!

select2 whith array

Hi,

I'm trying to use select2 with an array field in may schema. Like a mulit-value selection : http://ivaynberg.github.io/select2/#multi

But it's not working.

If I use select2 for a single vaule field works fine.

A standard select works for a array wojs fine too ( with select insinde ul->li)
I have looking forms-angular.js but with not success to find how to get select2 + tags work.

I am using this schema :

...
    role: {
        type: [String],
        default: 'usuario',
        enum: ['usuario', 'sysadmin', 'admin', 'vendedor'],
        form: {
            hidden: false,
            select2: {
                multiple: true,
                simple_tags: true
            }
        }
...

Thanks a lot,

WYSIWYG

Is somebody using forms-angular with WYSIWYG?

Is there a simple switch or are you integrating it programmatically?

Deep nesting

Hi there,

I desperately need deep nesting to work in a project im baseing to a large part on forms-angular. The issue is the data is not saved on level 3 and deeper. I need at least 3 levels.

To illustrate the scenario, think of your professional resume/CV you have 3 levels:

  1. level: Basic data on your self (name, email, phone etc.)
  2. level: Jobs you have had previosly (for example: worked for IBM from June 2010 to August 2012 as a proejct manager)
  3. level: Projects I was invoved with during me time at IBM (for example: Global Lean Project from June 2010 to January 2011 and SCRUM Train the Trainer from February 2011 to August 2012)

A simple model to illustrate:

'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var projectSchema = new Schema({
  projectName: {type: String},
  dateFrom: {type: Date},
  dateTo: {type: Date},
  projectDescription: {type: String, form: {type: 'textarea', rows: 'auto'}}
});

var jobSchema = new Schema({
  company: {type: String},
  title: {type: String},
  dateFrom: {type: Date},
  dateTo: {type: Date},
  jobDescription: {type: String, form: {type: 'textarea', rows: 'auto'}},
  projects: {type: [projectSchema]}  
});

var resumeSchema = new Schema({
  surname: {type:String},
  forename: {type:String},
  workHistory: {type: [jobSchema]},

});


var Nesting;
var modelName = 'Nesting';

try {
  Nesting = mongoose.model(modelName);
} catch(e) {
  Nesting = mongoose.model(modelName, resumeSchema);
}

module.exports = Nesting;

blueimp.fileupload error

Hi,
installation is ok and grunt serve seems to be ok. But when browser is launched, the following error appears inthe console :

TypeError: require is undefined
...ride&&(require_baseUrl_override="../"),require.config({baseUrl:require_baseUrl_o...
in jspdf.min.js (ligne 273, col. 21893)

Then another error (maybe related?) :
Error: [$injector:modulerr] Failed to instantiate module tmpApp due to:
[$injector:modulerr] Failed to instantiate module uploadModule due to:
[$injector:modulerr] Failed to instantiate module blueimp.fileupload due to:
[$injector:nomod] Module 'blueimp.fileupload' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.4.7/$injector/nomod?p0=blueimp.fileupload
minErr/<@http://localhost:9000/bower_components/angular/angular.js:68:12

...

But blueimp.fileupload is there in client/bower/blueimp-file-upload.

Any ideas ?
Any idea ?

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.