【发布时间】:2015-03-27 07:52:36
【问题描述】:
我有一个基于 AngularJS 构建的单页应用程序,该应用程序使用 HTML5 路由进行配置。 所以我使用:
http://www.example.com/products rather than http://www.example.com/#/products
我也有附属的通配符子域,例如:
http://myaffiliate.example.com
我使用这个控制器从一个火力基地收集关于我的附属公司的数据:
app.controller("ReplicatedController", function($scope, $firebaseObject) {
var parts = location.hostname.split('.');
var refSubdomain = parts.shift();
var ref = new Firebase("https://example-firebase.firebaseio.com/" + refSubdomain);
var syncObject = $firebaseObject(ref);
syncObject.$bindTo($scope, "coach");
});
这一切都很好,但除了使用通配符子域之外,我还需要附属机构才能使用 url。例如:
http://example.com/myaffiliate
是否可以这样做,我该怎么做?
【问题讨论】: