除非用户登录,否则通过adal.js运行auth的Angular应用程序不会加载模板部分

时间:2016-09-22 18:29:27

标签: angularjs adal

我使用adal-angular.js作为我的身份验证链的一部分。

一切都适用于需要身份验证的网页。 要求auth的页面将加载,但他们不会加载视图中包含的任何部分。

例如,index.html页面包含:

<ng-include src="'/module/utility/view/footer.html'"></ng-include>

仅在用户登录时才会显示页脚。

我怀疑我的问题类似于this错误报告,但我还没到达那里。

我尝试将anonymousEndpoints添加到我的adal init中,如下所示:

adalAuthenticationServiceProvider.init(
    {
        tenant: "xxx", // Optional by default, it sends common
        clientId: "xxx", // Required
        anonymousEndpoints: ['/app/module/utility/view/footer.html']
        // also tried:
        //anonymousEndpoints: ['/app/module/utility/view/']
        //anonymousEndpoints: ['/']
        //and soforth.
    },
    $httpProvider
);

仍然没有页脚。此外,没有错误。

任何帮助?

1 个答案:

答案 0 :(得分:1)

好的,答案很简单。

关于这个问题的小文档表明了这一点:

anonymousEndpoints: ['/app/module/utility/view/']

这对我没有用。这样做了:

anonymousEndpoints: ['/module/utility/view/footer.html']

路径需要相对于app.js ,这对我来说是在app文件夹中。