Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed May 29, 2018
1 parent 751efbf commit 309fa23
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions docs/guide/ngrest-model.md
Expand Up @@ -207,21 +207,16 @@ If collapsed is `true` then the form group is hidden when opening the form, othe
Sometimes you just want to trigger some javascript functions after the save/update process in the NgRest model, therefore you can add config options with wrapped inside a javascript function which will be evaluated in triggered, please take care of javascript errors and eval injections when using this method!

```php

public function ngRestConfig($config)
public function ngRestConfigOptions()
{
// ...

$config->options = [
'saveCallback' => 'function(ServiceMenuData) { ServiceMenuData.load(true); }', // this function callback will be trigger after save/update success calls.
return [
'saveCallback' => "['ServiceMenuData', function(ServiceMenuData) { ServiceMenuData.load(true); }]",
];

// ...

return $config;
}
```

When using an angular service injection, make sure to use strict di which is required since luya admin module version 1.2.

## Crud Relation Tabs

Sometimes it is useful and common to directly manage relational data inside the current ngrest crud. Therefore we have created something called {{\luya\admin\ngrest\base\NgRestModel::ngRestRelations()}}. Inside this method you can define relations which are also based on the NgRest concept.
Expand Down

0 comments on commit 309fa23

Please sign in to comment.