File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
angular . module ( 'firebase-example' , [ ] )
12
12
. controller ( 'firebaseCtrl' , function ( $scope , $timeout ) {
13
+ var fCtrl = this ;
14
+
13
15
$scope . add = function ( user ) {
14
16
$scope . creating = true ;
15
17
User . create ( user ) . then ( function ( ) {
16
18
$scope . creating = false ;
19
+ fCtrl . name = '' ;
17
20
$timeout ( ) ;
18
21
} , function ( ) {
19
22
$scope . creating = false ;
Original file line number Diff line number Diff line change @@ -54,10 +54,13 @@ <h3 class="panel-title">Users</h3>
54
54
55
55
angular.module('firebase-example', [])
56
56
.controller('firebaseCtrl', function ($scope, $timeout) {
57
+ var fCtrl = this;
58
+
57
59
$scope.add = function (user) {
58
60
$scope.creating = true;
59
61
User.create(user).then(function () {
60
62
$scope.creating = false;
63
+ fCtrl.name = '';
61
64
$timeout();
62
65
}, function () {
63
66
$scope.creating = false;
You can’t perform that action at this time.
0 commit comments