9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/generators/arcrud/arcrud_generator.rb', line 9
def copy_entity_base
angular_app_location = 'app/assets/javascripts/app'
directory 'entity', angular_app_location + '/%file_name%'
inject_into_file angular_app_location + '/app.js', :after => "\t$stateProvider" do
"\n\t\t\t.state('" + file_name + "', {
url: '/" + file_name + "',
controller: '" + file_name.capitalize + "Ctrl',
templateUrl: 'app/" + file_name + "/" + file_name + ".html',
resolve: {
" + file_name.capitalize + "List: ['" + file_name.capitalize + "Service', function(" + file_name.capitalize + "Service) {
return " + file_name.capitalize + "Service.query();
}]
}
})\n"
end
end
|