@@ -51,7 +51,7 @@ angular.module('<%= baseName %>')
51
51
$scope . open = function ( id ) {
52
52
var < %= name % > Save = $modal . open ( {
53
53
templateUrl : '<%= name %>-save.html' ,
54
- controller : < %= _ . capitalize ( name ) % > SaveController ,
54
+ controller : ' <%= _.capitalize(name) %>SaveController' ,
55
55
resolve : {
56
56
< %= name % > : function ( ) {
57
57
return $scope . < %= name % > ;
@@ -64,24 +64,23 @@ angular.module('<%= baseName %>')
64
64
$scope . save ( id ) ;
65
65
} );
66
66
} ;
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 % > ;
72
71
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
+ } ; < % } } ); %>
79
78
80
- $scope . ok = function ( ) {
81
- $modalInstance . close ( $scope . < %= name % > ) ;
82
- } ;
79
+ $scope . ok = function ( ) {
80
+ $modalInstance . close ( $scope . < %= name % > ) ;
81
+ } ;
83
82
84
- $scope . cancel = function ( ) {
85
- $modalInstance . dismiss ( 'cancel' ) ;
86
- } ;
87
- } ;
83
+ $scope . cancel = function ( ) {
84
+ $modalInstance . dismiss ( 'cancel' ) ;
85
+ } ;
86
+ } ] ) ;
0 commit comments