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

时间:2015-12-22 06:37:59

标签: javascript angularjs meteor angular-meteor

当路线不是/hideBanner时,我正试图显示横幅div。这是使用Angular和Meteor使用angular-with-blazeangularui:angular-ui-router软件包制作的网页。

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

为什么要提供完整的网址?

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>

0 个答案:

没有答案