@@ -124,84 +124,15 @@ angular.module('teachers')
124
124
} ;
125
125
126
126
127
-
128
-
129
-
130
-
131
-
132
-
133
127
function saveTeacher ( ) {
134
128
135
-
136
- console . log ( 'Try to save' )
137
-
138
- /*
139
- console.log(vm.teacherId)
140
- TeachersService.update({id: vm.teacherId}, function(){
141
- console.log('Teacher changes saved successfully')
142
- console.log(vm.teacherClasses)
143
- }, function(error){
144
- console.log('Una mierda')
145
- console.log(error)
146
- })
147
- */
148
-
149
- /*
150
- vm.teacherSubjects = TeachersService.update({id: vm.teacherId}, function(){
151
- console.log('Teachers subjects')
152
- console.log(vm.teacherSubjects)
153
- })
154
- */
155
-
156
-
157
- /*
158
- // El metodo funciona pero sin el id en la url
159
- console.log('vm.teacher.teacherId')
160
- console.log(vm.teacher.teacherId)
161
-
162
- vm.teacher.$update(function(){
163
- console.log('success')
164
- }, function(error){
165
- console.log('error')
166
- console.log(error)
167
- });
168
- */
169
- console . log ( vm . teacher . teacherId )
170
- console . log ( vm . teacher )
171
- // vm.teacher.data = {}
172
- // vm.teacher.data.teacherId = vm.teacherId
173
- //console.log(vm.teacher)
174
- //var teacher = {someProp:"Fiat", model:"500", color:"white"};
175
-
176
- //TeachersService.update({ id:vm.teacherId}, teacher);
177
-
178
-
179
129
vm . teacher . $update ( function ( ) {
180
- console . log ( 'success ' )
130
+ console . log ( 'Success saving the teacher. ' )
181
131
} , function ( error ) {
182
- console . log ( 'error ' )
132
+ console . log ( 'Error saving the teacher. ' )
183
133
console . log ( error )
184
134
} ) ;
185
135
186
- /*
187
- TeachersService.update({ id:vm.teacherId}, vm.teacher, function(){
188
- console.log('done')
189
- }, function(error){
190
- console.log('error')
191
- console.log(error)
192
- });
193
- */
194
-
195
-
196
-
197
- /*
198
- vm.teacher.$update(function () {
199
- console.log('Teacher changes saved successfully');
200
- $mdDialog.cancel();
201
- }, function(){
202
- console.log('There are any problem saving the teacher.')
203
- });
204
- */
205
136
}
206
137
207
138
0 commit comments