Fullpage.js在标签和锚名之间添加了斜杠——ng-include会导致冲突

Fullpage.js adds slash between hashtag and anchor name- ng-include causes conflict

本文关键字:ng-include 冲突 添加 标签 js 之间 Fullpage      更新时间:2023-09-26

对于一个简单的站点,我使用fullpage.js,我也使用angular指令。我包含了一个。php文件,突然fullpage.js锚停止工作。它在锚名之前和#之后添加斜杠。

问题在于ng-include。我的"为什么"指令中有一些"包含"。我把那些ng-include改成了指令。

<div id="fullpage">
<div class="section" id="main-description">
    <div class="animated fadeIn" main-description></div>
</div>
<div class="section" id="features">
    <div features></div>
</div>

这是我的指令:

app.directive('mainDescription', function () {
    return{
        restrict: 'EA',
        templateUrl: 'templates/description.html'
    }
});
app.directive('features', function () {
    return{
        restrict: 'EA',
        templateUrl: 'templates/features.phtml'
    }
});

而第一个指令不影响锚。第二个开始问题

我使用。php而不是。php,它工作。但是不知怎么的,我真的很想知道是什么原因导致了这个问题。

更新

嗯,我错了关于。php文件和。php。问题是我的特性中的一些代码。phtml文件。在feature。php

中还有两个指令
<div class="bounceInLeftPart  hidden-xs hidden-sm" why></div>
<div class="bounceInLeftPart hidden-md hidden-lg" id="why-mobile" why-mobile></div>

这不是问题的确切答案。Fullpage.js在angular.js的ng-include中有一个问题。我把这些ng-include改为自定义指令,它工作了。