Skip to content

Commit

Permalink
fix bug: 编辑description后没有立即显示更新后的内容
Browse files Browse the repository at this point in the history
  • Loading branch information
baya committed Sep 29, 2013
1 parent 138ce8a commit 4150cfc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 14,7 @@ angular.module('gStar.directives', []).
scope: {descriptionhtml: '@', starid: '@', description: '@'},
template: '<p ng-click="edit()" ng-bind-html="descriptionhtml"></p>'
'<textarea ng-model="description"></textarea>',
controller: 'StarsCtrl',
link: function( $scope, element, attrs, ctrl ){
var inputElement = $( element.children()[1] );
var textElement = $( element.children()[0] );
Expand Down Expand Up @@ -47,6 48,7 @@ angular.module('gStar.directives', []).
var data = {id: $scope.starid, description: $scope.description};
var nr = new SaveStarDescription(data)
nr.$save();
$scope.descriptionhtml = nr.description.replace($scope.re, $scope.hit);
}
});
}
Expand Down

0 comments on commit 4150cfc

Please sign in to comment.