GrailsInAction / graina2

Source code for the 2nd edition of Grails in Action
90 stars 93 forks source link

Redundant unscoped isEditState variable used in listing 13.10, 13.11 #125

Open glenasmith opened 9 years ago

glenasmith commented 9 years ago

The Angular.js code in Hubbub.js functions $scope.updatePost and $scope.deletePost contains references to an unscoped isEditScope variable. The unscoped variable looks like a remnant of some earlier refactoring.

Since the isEditState variable is unscoped (rather than being referenced as $scope.isEditState), it won't bind to the Angular UI directive for ng-show in the gsp, and will have no visual effect.

There is already code in the update callback inside updatePost() that correctly sets the state of $scope.isEditState on update, so the unscoped isEditState = false line is entirely unnecessary (and misleading) in both updatePost() and deletePost().