generator-steroids
Version:
A Yeoman generator for Steroids
29 lines (17 loc) • 686 B
JavaScript
// The contents of individual model .js files will be concatenated into dist/models.js
(function() {
// Protects views where angular is not loaded from errors
if ( typeof angular == 'undefined' ) {
return;
};
var module = angular.module('<%= _.capitalize(resourceName) %>Model', ['restangular']);
module.factory('<%= _.capitalize(resourceName) %>Restangular', function(Restangular) {
return Restangular.withConfig(function(RestangularConfigurer) {
RestangularConfigurer.setBaseUrl('http://localhost/data');
RestangularConfigurer.setRequestSuffix('.json');
RestangularConfigurer.setRestangularFields({
id: "<%= resourceName %>_id"
});
});
});
})();