marmelab / ng-admin Goto Github PK
View Code? Open in Web Editor NEWAdd an AngularJS admin GUI to any RESTful API
Home Page: http://ng-admin-book.marmelab.com/
License: MIT License
Add an AngularJS admin GUI to any RESTful API
Home Page: http://ng-admin-book.marmelab.com/
License: MIT License
It would be cool to have a way to realtime sort the results by a selected column in both asc/desc way
On a field instance, when I call .validation({ "required": true })
, inputs are no longer accepted, because the maxLength is set to 0. It seems that the validation object passed to validation()
doesn't extend the default one, but replaces it. It is a problem.
In Configuration section, where it says "will allows you" it should be "will allow you".
Also, in same section, it would be nice to break this long line of code, which causes a horizontal scrollbar in code block:
app.config(function(NgAdminConfigurationProvider, Application, Entity, Field, Reference, ReferencedList, ReferenceMany) {
Last bit: is the term edition, used in body text and in code, intended? Or could that be something like:
(Side note: we choose not to do a PR for this, hope that's ok.)
Currently, when I define a field like new Field('book')
, it automatically takes the label "Book", which is good. But, when I define a field like new Field('book_author')
, it automatically takes the label "Book_author", which is bad. It forces me to override the label each time I use an underscore name. I'd prefer "Book Author".
$ npm install
npm WARN package.json [email protected] No repository field.
Maybe it's just a matter of documentation, but adding custom actions to be displayed in the CRUD area is currently not straightforward.
Here is my use case : for one of the entities, I'd like to update the HTML of the datagrid, to add bootstrap classes.
I would like to be able to do this in a fine-grained way:
commentEntity.addView(new ListView('comment-list')
.templates({
'datagrid.html': "<table><table-header></table-header></table>"
})
I would also like to do it for the entire application, so we need some sort of cascading capability:
for each view, for each directive, use the template
This also implies that the templates of ng-admin's directives should be much slower, calling subdirectives that can be, in turn , easily overridden (think Twig blocks).
When the user creates a new object, FormController.submitCreation loads the edit screen by:
self.$location.path('/edit/' + self.entity.name() + '/' + response.data.id);
This only works if the id attribute for the object is 'id'.
if possible I may have missed, but in my project, REST API work on Symfony2 and routes.
-deleted-
Hi.
I must say that the README is not clear enough regarding how to use this backend... A magic tool that allows anyone to build a backend interface in a couple of seconds should deserve an extensive documentation for newcomers, especially since the blog post does not match the current code base (obviously).
I suggest to add the HTML code in the README (my first attempt failed because of a missing Angular directive).
William
When deleting some documents, I got "Delete documents 3?". It would be better to get name of document in this message, something like "Delete document 'Why ng-admin rocks...'?". Passing an extra parameter accepting a callback would be better.
See related source.
And what about replacing this h2
by the form title?
Moreover, it should be at singular form by default (document
, not documents
).
Is there a way to allow for the collection returned by a collection request to be nested under a "results" property? Something akin to this:
{
"results": []
}
Rather than just
[]
For the response?
Thanks for your help!
Why don't you use angular-schema to define fields?
It allows to use the same validators for api and admin forms.
I have a fresh project with the included config-dist.js and when I save a new entity there is no data in the request payload that goes to the server. I thought it might have just been me, but I tried on the demo at http://ng-admin.marmelab.com/ and saw the same thing, post data does not appear to get sent with the POST request when saving a new entity.
I was working on this spec for my project, but since last update it's break. Submit button doesn't work.
Have you done some changes on routes ? I need to call another state in listView ?
I've scaffolded a project with yo angular
, but I'm seeing some problems maybe other have already solved.:
index.html
as other plugins does (see the index.html)<div ui-view>
, I need to bower install ui-router?My goal is to integrate ng-admin with Drupal's RESTful module
Like we can disable on Dashboard a normal Field, using .dashboard(false), there is a method to disable Reference, ReferencedList and ReferenceMany Fields on Dashboard?
We have seen that all dependencies are hardcoded.
Do you do other soon ?
A CDN link of ng-admin and its dependencies in CDN also be great ;)
I have ng-admin up and running using json-server running a copy of my data extracted to json. I'm trying to determine how to make this work with two lookup tables that are linked. That is, I have a, for example, DocumentType table that's a simple ID and Description table. I also have a DocumentSubType table that, as well as having the ID and Description fields, links back to the DocumentType table via a field named, appropriately, docTypeId. What I would like to see when looking at the list of DocumentSubTypes is the Id, Description, and DocumentType_Description. Also, when editing a DocumentSubType, I would like to see the docTypeId handled as a dropdown that displays the DocumentType Descriptions. I've tried using the Reference field type in my config, but I'm not getting the expected results. How would I go about getting this to work like I would like it to?
As a separate, but related question: In order to create new records in a table, does ng-admin only work if the ID field of a table is named 'Id" Or can the Id field be named something like 'DocSubTypeId'?
The flickering created by the grey Ajax loader layer is distracting. Why not use something more discreet, like http://ricostacruz.com/nprogress/?
Hi! This project will be very useful for me, really thank you!
I Would like to know if is in your to-do list allow user to upload some kind of file in server or s3 etc etc...
I think this could be very useful :)
Thanks
Its would be more awesome if you can add some auth system :)
Thanks
How do I handle errors from server? How do I notify ng-admin that a validation error ocurred on the server, after trying to save the model, for example? Maybe a validation that can only occur in the server.
Can I use another validation lib, other than the builtin?
Currently, a call to view.addField(field)
internally calls field.setView(view)
. Not only is this bidirectional relationship a not-so-good practice, it also prevents the reuse of fields.
We need to refactor the way fields interact with view to avoid the dependency of field to view, and meake them portable.
Hello all
we must be missing something obvius, I guess. We've been through GitHub readme as well as launch post, but still it's not totally clear to us how to use ng-admin.
If we follow the launch post, it speaks about:
lib/config.js
file: where is that/should that file be located?grunt
: from any working directory?If we go along readme, it speaks about:
ng-admin/src/javascripts/bower_components/almond/almond.js
Side note: we did run npm install
from ng-admin cloned repo root directory.
Could you please give us some hint on this? Thanks for your time
Do you think it's possible to add custom input, like search in column, in of result table ?
Can we possible to add custom element on ListView, like a select for maxperpage ?
I have seen that it's possible to addField() to ListView but this function add it on all rows logicaly.
Maybe an addElement() function could be cool, to customize as we like your API instead of insert it in ng-admin.js
the cssClass()
field attribute could be improved in two directions:
ngClass
instead of class
to allow dynamic class according to elements in the entry.That would allow to highlight abnormal values in a datagrid simply using CSS...
I have an entity which has many to many relation with another entity which has 500K rows. Will multi select work?
Hello, I was wondering if ng-admin can be used with the parse.com cloud code instances? They provide a REST api to all their classes.
In some cases we need to use different base api url for different entities.
Live example ( Parse.com ):
api.parse.com/1/users
api.parse.com/1/classes/CustomClass
Do we have this possibility in ng-admin?
When i submit edit form, i have this error :
TypeError: Cannot use 'in' operator to search for 'here_the_first_field_of_the_form' in undefined
But entity is updated anyway, submit just block with this error.
Have you got an idea ?
thanks
Hello,
I am trying to use this to build a quick back-end, but my IDs are alphanumeric strings, not just integers. Is this possible to use these on reference fields?
Thanks in advance!
Actually, ReferencedList, retrieve all referenced entity, and filter them client side.
It would be nice to be able to add a dynamic filter on the request to retrieve only the needed referenced entity.
Hi there, very good idea to share the missing AngularJS administration !
Did you think about API auto discovery ?
There's a lot of initiatives to make APIs hypermedia, such as:
That could be even more easy than describing the API in a JS file :)
In a previous PR (#122), I fixed the problem of wysiwyg fields being displayed as HTML the wrong way: by displaying the unescaped HTML. This prevents truncation, and exposes the admin user to XSS attacks.
The right way to do it is to display a version of the wysiwyg stripped of HTML tags, equivalent to the result of PHP's trip_tags()
function.
$ bower install
... (behold the matrix) ...
Unable to find a suitable version for angular, please choose one:
1) angular#1.2.15 which resolved to 1.2.15 and is required by angular-mocks#1.2.15, angular-scenario#1.2.15
2) angular#1.2.24 which resolved to 1.2.24 and is required by angular-cookies#1.2.24, angular-resource#1.2.24, angular-route#1.2.24, angular-sanitize#1.2.24
3) angular#>= 1.0.8 which resolved to 1.2.24 and is required by angular-ui-router#0.2.11
4) angular#>=1 which resolved to 1.2.24 and is required by angular-bootstrap#0.11.0
5) angular#~1.2.16 which resolved to 1.2.24 and is required by angular-admin
6) angular#* which resolved to 1.2.24 and is required by restangular#1.4.0
Prefix the choice with ! to persist it to bower.json
It would be nice/cool if you could deep-nest entities in ng-admin when performing a save operation. As an example, with the demo data if I could embed a full tag object inside of the tags[] when I post, rather than just a collection of the ids for the included objects.
hello,
the db model i'm using has a 'details' object where specific user details are stored. I couldn't create a field for its items.
creating a field using 'details' as a name would show the json string of it. i tried to create a field with 'details.key', but it didn't work. Any idea?
The ideal would be to allow something like a menuTemplate() call in the DashboardView:
new DashboardView('book-dashboard')
.menuTemplate('<a ng-click="sidebarController.displayList(entity, $event)"><span class="glyphicon glyphicon-pencil"></span> Books</a>')
Or does it make sense to introduce yet another view for the menu?
I downloaded the app (ver. 0.3.2) yesterday & Configured it but it bugged!
var user = new Entity('users');
app.addEntity(user);
user
.label('Recent Users') // does not work
angular throws this:
Uncaught Error: [$injector:modulerr] Failed to instantiate module adminApp due to:
TypeError: undefined is not a function
at http://localhost:3000/config.js:41:8 --> points to where label(..) is defined
If I remove label(..) call, it shows the dashboard correctly.
But when I click the items on left (to list the users), angular again throws:
TypeError: undefined is not a function
at new a (http://localhost:3000/ng-admin-app/bower_components/ng-admin/build/ng-admin.min.js:9:11646)
In the page, I see this: {{ listController.title }}
Inspecting the above ng-admin.min.js
the error points to section: this.entityLabel=this.view.label()
How to get rid of it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.