javascript - Angular js 自定义域映射

标签 javascript angularjs dns routes

我想让我的门户上的用户将他们的域映射到他们的页面和内部页面。

因此,用户站点 URL http://www.username.com应映射到 http://example.com/userid ,同样,里面的所有链接也应该映射。喜欢, http://www.user-id.com/ 第1页 => http://example.com/userid/ 第1页 http://www.user-id.com/ 第 1 节/第 1 页 => http://example.com/userid/ 第 1 节/第 1 页

有人用 Angular JS 做过这个吗?我正在使用 Angular 1.3 并打开以移动到 1.4 或 1.5

最佳答案

这是一个使用 ui-router 进行路由器设置的示例,可以匹配您正在尝试的内容:

// APPLICATION ROUTES
        // -----------------------------------
        // For any unmatched url, redirect to /app/
        $urlRouterProvider.otherwise("/login/signin");
        //
        // Set up the states
        $stateProvider.state('app', {
            url: "/app",
            templateUrl: "views/app.html",
            resolve: loadSequence('any library you want'),
            abstract: true
        }).state('app.page1', {
            url: "/page1",
            templateUrl: "views/page1.html",
            resolve: loadSequence('any library you want'),
            title: 'Dashboard'
        }).state('app.page1.section1', {
            url: '/page2',
            template: '<div ui-view class="fade-in-up"></div>',
            title: 'Page 2',
     });

关于javascript - Angular js 自定义域映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36085246/

相关文章:

javascript - 平滑滚动到内部链接的最佳方法

javascript - 为什么 reduce 不打印第一个值?

javascript - Angularjs选择: How to get the position of the selected item and set default selection

dns - 为 DMARC 等将 DNS IN TXT 记录拆分为多行

networking - 如何克服根域CNAME限制?

ssl - Heroku、DNSSimple 和 SSL : web app is still not secure

php - AJAX 表单提交错误

javascript - 在 React Native 中加载组件时出错

angularjs - Firebase 和 Geofire 性能 : Get keys in array instead of 1 by 1

javascript - Angular.js 最佳实践 - 扩展 Controller 、覆盖 Controller 默认值