Skip to content

Commit 6d5f07a

Browse files
author
Robert Yokota
committed
Fix controller for minification - from eeskildsen
1 parent d69c3bd commit 6d5f07a

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

entity/templates/public/js/entity/_entity-controller.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ angular.module('<%= baseName %>')
5151
$scope.open = function (id) {
5252
var <%= name %>Save = $modal.open({
5353
templateUrl: '<%= name %>-save.html',
54-
controller: <%= _.capitalize(name) %>SaveController,
54+
controller: '<%= _.capitalize(name) %>SaveController',
5555
resolve: {
5656
<%= name %>: function () {
5757
return $scope.<%= name %>;
@@ -64,24 +64,23 @@ angular.module('<%= baseName %>')
6464
$scope.save(id);
6565
});
6666
};
67-
}]);
68-
69-
var <%= _.capitalize(name) %>SaveController =
70-
function ($scope, $modalInstance, <%= name %>) {
71-
$scope.<%= name %> = <%= name %>;
67+
}])
68+
.controller('<%= _.capitalize(name) %>SaveController', ['$scope', '$modalInstance', '<%= name %>',
69+
function ($scope, $modalInstance, <%= name %>) {
70+
$scope.<%= name %> = <%= name %>;
7271

73-
<% _.each(attrs, function (attr) { if (attr.attrType === 'Date') { %>
74-
$scope.<%= attr.attrName %>DateOptions = {
75-
dateFormat: 'yy-mm-dd',
76-
<% if (attr.dateConstraint === 'Past') { %>maxDate: -1<% } %>
77-
<% if (attr.dateConstraint === 'Future') { %>minDate: 1<% } %>
78-
};<% }}); %>
72+
<% _.each(attrs, function (attr) { if (attr.attrType === 'Date') { %>
73+
$scope.<%= attr.attrName %>DateOptions = {
74+
dateFormat: 'yy-mm-dd',
75+
<% if (attr.dateConstraint === 'Past') { %>maxDate: -1<% } %>
76+
<% if (attr.dateConstraint === 'Future') { %>minDate: 1<% } %>
77+
};<% }}); %>
7978

80-
$scope.ok = function () {
81-
$modalInstance.close($scope.<%= name %>);
82-
};
79+
$scope.ok = function () {
80+
$modalInstance.close($scope.<%= name %>);
81+
};
8382

84-
$scope.cancel = function () {
85-
$modalInstance.dismiss('cancel');
86-
};
87-
};
83+
$scope.cancel = function () {
84+
$modalInstance.dismiss('cancel');
85+
};
86+
}]);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-angular-express-sequelize",
3-
"version": "0.1.11",
3+
"version": "0.1.12",
44
"description": "A Yeoman generator for AngularJS + Express + Sequelize",
55
"keywords": [
66
"yeoman-generator",

0 commit comments

Comments
 (0)