fix weixin absUrl() got error address

This commit is contained in:
yafeilee 2014-05-19 21:51:29 +08:00
parent 45ff953d39
commit 841f4099ac
3 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
@app.controller 'ArchivesController',[ '$scope', '$http', '$location', '$timeout', '$cookies', ($scope, $http, $location, $timeout, $cookies)->
url = $location.absUrl() + ".json"
url = window.location.pathname + ".json"
start_with = $cookies.start_with if window.location.pathname == $cookies.start_with_type
$http
url: url

View File

@ -1,8 +1,7 @@
@app.controller 'CommentsController', ['$scope', '$http', '$location', '$timeout', ($scope, $http, $location, $timeout)->
url = $location.absUrl() + "/comments.json"
url = window.location.pathname + "/comments.json"
$http.get(url).success (data)->
console.log data
$scope.comments = data
$scope.publish_success = null

View File

@ -1,5 +1,5 @@
@app.controller 'LikesController', ['$scope', '$http', '$location', '$cookies', ($scope, $http, $location, $cookies)->
url = $location.absUrl() + "/likes"
url = window.location.pathname + "/likes"
$http.get url
.success (res)->
@ -9,7 +9,7 @@
if $scope.like
$http
url: $location.absUrl() + "/likes/#{$scope.like}/is_liked"
url: window.location.pathname + "/likes/#{$scope.like}/is_liked"
method: 'GET'
.success (res)->
if res == 'true'