0
我想在我的index.html中包含不同的標頭,其中一個用於用戶登錄時,另一個用於他不在時。這是我的想法:Angularjs包括基於位置的部分
<script>console.log(location.hash === '#/')</script>
<div ng-if="location.hash === '#/' " id="header" ng-include="'partials/homeHeader.html'"></div>
控制檯打印爲true,但ng-if中的部分不能正常工作。我該如何解決這個問題,還是有更好的解決方案?
謝謝!
'location'是最可能不在導致問題的「範圍」上。 –