использование патерна фабрика, как правильно
так
function ( app ) {
app.factory ( "Distributor", [ "$resource", function ( $resource ) {
return $resource(
'/cw/cmb/translator/messageDistributorSources', {}, {
query: {
method: 'POST'
}
} );
} ] );
}
или так
function ( app ) {
app.factory ( "Distributor", [ "$resource", function ( $resource ) {
var distributor = new $resource(
'/cw/cmb/translator/messageDistributorSources', {}, {
query: {
method: 'POST'
}
} );
distributor.catalogType = "ALL";
return distributor;
} ] );
}