角JS自定义域映射 [英] Angular js custom domain mapping

查看:152
本文介绍了角JS自定义域映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给用户在我的门户网站有自己的域名映射到他们的网页和内部页面从他们的。

I want to give the users on my portal to have their domains mapped to their page and internal pages from their on.

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

So, the user site url http://www.username.com should map to http://example.com/userid, similarly all the links inside should also map. Like, http://www.user-id.com/page1 => http://example.com/userid/page1 http://www.user-id.com/section1/page1 => http://example.com/userid/section1/page1

有一些身体角度JS这样做呢?我采用了棱角分明1.3和开放式移动到1.4或1.5

Has some body done this in angular js? I am using angular 1.3 and open to move to 1.4 or 1.5

推荐答案

下面是UI的路由器为例路由器设置,可以匹配你正在尝试什么:

Here is an example router setup with ui-router that could match what you are attempting:

// 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',
     });

这篇关于角JS自定义域映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆