Comments (20)
Hello,
What do you mean by doesn't work ? Do you have any Javascript errors ? What is your configuration for this view ?
from ng-admin.
i put a custom template to add edit form directly in a row (with collapse). When i use FormController for this form, i have this error :
Error: [$injector:unpr] Unknown provider: viewProvider <- view
from ng-admin.
Thanks for the informations.
Do you use the 0.3.3 version or the master one ?
from ng-admin.
Last version, 0.3.3
from ng-admin.
How can i simply call editController in a view ?
from ng-admin.
Hello, we use controllerAs
to inject the controller instance in the view.
You can use it like this
from ng-admin.
Thank you very much ;)
from ng-admin.
Hello,
I test this but don't work, what i've done :
Directive for customer entity :
app.directive('customerEdit', ['$location', function ($location) {
return {
controllerAs: 'frontController',
templateUrl: 'ng/customers/edit'
};
}]);
In templateUrl i have same the form that you said for edit, but submit don't work.
I've test to put directly ng-controller in the form, it's submit but don't update entity.
Any idea please ?
from ng-admin.
I've test with :
controllerAs: 'FormController'
controllerAs: 'EditController'
Any idea please ?
from ng-admin.
Hello,
Is this issue still related to ng-admin ?
from ng-admin.
Absolutely, because i don't find the way to call formController in rows list like you said.
from ng-admin.
IMO it is an angular issue, you should look at the require
property for your directive, to get access to the parent controller you want.
see http://stackoverflow.com/questions/15622863/angularjs-directive-controllers-requiring-parent-directive-controllers and https://docs.angularjs.org/guide/directive#creating-directives-that-communicate
from ng-admin.
Thanks RobinBressan, it's a good track
from ng-admin.
Any progress on this one?
from ng-admin.
Yes i'm on it, just try to get formController in ListView.
from ng-admin.
Since the last update, it's cool for me to custom layout, and templates.
Just a little explanation:
I don't use require in my project, but i found how to integrate all custom view via directives.
I make directive for layout (works), but i test a directive for listView of an entity, it doesn't work for data. I think my problem is the controller: How can i call differents controller of ng-admin ?
Some code:
app.directive('customCustomersList', ['$location', function ($location) {
return {
templateUrl: '/ng/customers/list',
controllerAs: 'DatagridController'
};
}]);
DatagridController ?
[...]
var customerCustomList = '<custom-customers-list></custom-customers-list>';
[...]
app.customTemplate(function(viewName, what) {
if (viewName === 'ListView') {
return customerCustomList;
}
if (viewName === 'EditView') {
return customerCustomEdit;
}
})
from ng-admin.
No need to inject controllers, i just use my customTemplate based on listView ng-admin.
For my editRow, i use ng-repeat-start and ng-repeat-end to inject edit between each row, just with angular and bootstrap css.
from ng-admin.
OK, can you close the issue if it's OK for you?
Moreover, I think other ng-admin users would love to read about your customization. If you have a blog, would you mind writing a few lines about it?
from ng-admin.
Just to illustrate:
<tr ng-repeat-start="customer in customers">
<td ng-click="collapseRows = !collapseRows" class="collapsible-row">{{customer.UserName}}</td>
</tr>
<tr ng-repeat-end ng-hide="collapseRows">
<td>Edit Form</td>
</tr>
from ng-admin.
Sorry friend, but I never had time to make me a blog, and it's not envy that I am missing :(
from ng-admin.
Related Issues (20)
- The template scope's Datastore variable bug (in showView)
- Entities with no login required HOT 1
- Previous state in onSubmitSuccess HOT 1
- Page reload goes back to first page HOT 1
- Page reload on create/edit/delete invalidates filters
- Alternative for the singleApiCall
- Upgrade to Angular 5 HOT 2
- Cancel button in edit form HOT 1
- memory leak when $state.reload
- websocket practice HOT 2
- The successful presentation of Cannot read property'message'of undefined error in creationView
- Filter value typed while loading get discarded once result is loaded
- Can't update a referenced field after the reference was deleted
- Multi-file upload uploads same file n times
- ype HOT 1
- how can I use other field's value be a query condition with referenceField HOT 1
- How to get the entire listView() data into customDirective using ngAdmin
- Enums no appropriate shows in admin
- batch actions doesn't appear on selection if we use .actions to a listView
- Documentation link leads to cloudflare error page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-admin.