0

In the listview/creation view , I am trying to add the custom notification message instead of default notification (please refer screenshot) when the user clicks the save button.

Can someone please let me know if there a way to add custom notification message ?enter image description here

var app = nga.entity('app').label('App'); // the API endpoint for users will be 'http://jsonplaceholder.typicode.com/users/:id

        app.listView()
        .title('App Lists')
        .fields([
            nga.field('id'),
            nga.field('appName').label('App Name'),
            nga.field('appId').label('App Id')
            .validation({ required: true, pattern: '[A-Za-z0-9\.\-_]{1,50}' }),
            nga.field('appSecret').label('App Secret'),
            nga.field('userId').label('User Id'),
            nga.field('description').label('App description'),
            nga.field('published', 'choice').choices([
                { value: true, label: 'true' },
                { value: false, label: 'false' }
                ])
        ])
        .exportFields([])
        .listActions(['<app-property post="entry"></app-property>','edit', 'delete'])
        .perPage(10) // limit the number of elements displayed per page. Default is 30.
        .batchActions(['delete', '<my-custom-directive entries="selection"></my-custom-directive>'])
        ;
Vivek
  • 281
  • 2
  • 7
  • 21

2 Answers2

0

It might not be exactly what you're looking for, but on the latest branch (1.x.x), you can translate this message with:

myApp.config(['$translateProvider', function ($translateProvider) {
    $translateProvider.translations('en', {
      'CREATION_SUCCESS': 'My custom message onCreateSuccess()',
      'EDITION_SUCCESS': 'My custom message onEditSuccess()'
    });
    $translateProvider.preferredLanguage('en');
}]);

See the translation chapter here: https://github.com/marmelab/ng-admin/blob/master/doc/Translation.md

F3L1X79
  • 2,575
  • 2
  • 29
  • 45
-1

Maybe you don't need it anymore, but I'll post it to those who will look here in future.
In ng-admin you have notification service which you could inject into your controller. Then you could do something like

this.notification.log(yourMsg, {addnCls: 'humane-flatty-success'};

To change default messages please look into the source of ng admin list directive.

Adinia
  • 3,722
  • 5
  • 40
  • 58