Tag: angular度ui路由器

Angular没有响应任何路由与ui路由器 – URL只是消失时,我进入

我正在使用NodeJS + Express来为Angular应用程序提供HTML页面。 它加载时似乎工作正常。 没有错误。 问题是那个页面几乎是空白的 – 除了标题。 但是应该去哪里<div ui-view></div>部分不会显示任何内容。 更糟的是,当我去一个地址,像 http://localhost:7070/admin/#/rounds 浏览器只是改变它 http://localhost:7070/admin/#/ 并回到没有显示。 我的angular度应用程序,在index.js看起来像这样: 一些.run()和.config()设置 app.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) { // It's very handy to add references to $state and $stateParams to the $rootScope // so that you can access them from any scope within your applications.For example, // <li […]

如何通过Express路由到多个Angular应用程序?

问题是,我有一个server和client文件夹,而不是客户端我有2个Angular应用程序:1个网站和1个仪表板。 https://github.com/leongaban/bitage/tree/website 目前,我运行服务器后,并击中path/你被路由到网站的应用程序,一旦我似乎无法路由到仪表板的应用程序。 文件夹结构: server/ client/ website/ dashboard/ 服务器/内的main.js正确路由到网站应用程序,但无法路由到仪表板/ //website api ============= var website = express.Router(); app.use('/', website); app.use('/', express.static("../client/website/")); console.log(__dirname + "../client/website/"); website.use(function(req, res, next) { console.log(req.method, req.url); next(); }); website.get('/', function(req, res) { var path = 'index.html'; res.sendfile(path, { 'root': '../client/website/' }); }); //dashboard api =============== var dashboard = express.Router(); app.use('/dashboard', dashboard); app.use('/', […]