Javascript $location.path()提供完整URL,而不是Meteor中的相对路径

Javascript $location.path()提供完整URL,而不是Meteor中的相对路径,javascript,angularjs,meteor,angular-meteor,Javascript,Angularjs,Meteor,Angular Meteor,当路径不是/hideBanner时,我试图显示一个横幅div。这是一个使用angularui:angularui路由器软件包,使用angularui和Meteor制作的网页 问题:但是$location.path()给了我http://localhost:3000/hideBanner而不是/hideBanner 为什么要给出完整的URL angular.module('myApp').controller('BannerCtrl', function($scope, $location) {

当路径不是
/hideBanner
时,我试图显示一个横幅div。这是一个使用angularui:angularui路由器软件包,使用angularui和Meteor制作的网页

问题:但是
$location.path()给了我
http://localhost:3000/hideBanner
而不是
/hideBanner

为什么要给出完整的URL

angular.module('myApp').controller('BannerCtrl', function($scope, $location) {

    $scope.showBanner = function() {
        console.log($location.path());
        return $location.path() != '/hideBanner';
    }

})
index.ng.HTML的HTML

<div class="banner" ng-controller='BannerCtrl' ng-show='showBanner'></div>


这太奇怪了,你使用什么样的路由?@Michelem我正在使用常规的
ui.router
mmm你能移动
console.log($location.path())吗
是否在
showBanner
函数之外,只是为了尝试返回正确的值?(我不认为)那么这个
ng show='showBanner'
应该是
ng show='showBanner()'
@Michelem Yes更改为
ng show='showBanner()
导致它现在工作:)