fix repeat click like button when page refreshing

This commit is contained in:
yafeilee 2015-04-05 09:10:10 +08:00
parent 306e3c01ab
commit edd192135a
2 changed files with 5 additions and 2 deletions

3
.ackrc Normal file
View File

@ -0,0 +1,3 @@
--ignore-file=ext:log
--ignore-dir=public
--ignore-dir=tmp

View File

@ -4,7 +4,7 @@
$http.get url
.success (res)->
$scope.count = res.count
$scope.like = $cookies.like
if $scope.like
@ -12,7 +12,7 @@
url: window.location.pathname + "/likes/#{$scope.like}/is_liked"
method: 'GET'
.success (res)->
if res == 'true'
if res == true
$scope.is_liked = true
else
$scope.is_liked = false