-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
Following the style in styles/ams.js I added this to my code, however restmod doesn't seem to be calling decodeName or encodeName at all. (This is with restmod v1.1.0)
MyModule.config(function(restmodProvider) {
restmodProvider.rebase('MyAPIPacker');
});
MyModule.factory('MyAPIPacker', function(restmod, inflector, DefaultPacker) {
return restmod.mixin('DefaultPacker', {
$config: {
style: 'MyAPI',
jsonMeta: '.',
jsonLinks: '.'
},
$methods: {
// special snakecase to camelcase renaming
type: {
decodeName: function(_v) { debugger; inflector.camelize(_v); },
encodeName: function(_v) { debugger; return inflector.parameterize(_v, '_'); }
}
},
$hooks: {
// Add .json to all requests
'before-request': function(req) {
req.url += '.json';
}
}
});
});
Metadata
Metadata
Assignees
Labels
No labels