可以与UI路由器AngularJS处理多个参数呢? [英] Can ui-router handle multiple parameters in AngularJS?

查看:132
本文介绍了可以与UI路由器AngularJS处理多个参数呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个目前建有在最后一个参数的静态基础URL的应用程序。我想,而不是有基本的URL默认一个vaule,但有能力基于几个选项构建的路线。所以现在它的设立为:

I have an app that is currently built to have a static base URL with a parameter at the end. I would like to instead have the base URL default to one vaule, but have the ability to built routes based on several options. So for now its set up as:

  .state('ball', {
    parent: 'ballLayout',
    url: '/ball/{urlName}',
    views: {
      'cube.head': {
        templateUrl: 'partials/views/ball.head.html',
        controller: 'BallCtrl'
      }
    }
  });

静态球值是我想改变什么。基本上我想有传入的URL,将工作的可选列表,但没有什么是present则默认为球。因此,例如:

The static ball value is what I'd like to change. Basically I'd like to have an optional list of incoming URLs that would work, but when nothing is present it defaults to ball. So for instance:

球/标题的页面

BAT /标题的页面

bat/title-of-page

篮/标题的页面

兽/标题的页面

这些将所有的工作,并构造URL时,它会默认为球/

These would all work, and when constructing the URL it would default to ball/

是这样的可能吗?人们会如何去执行。

Is something like this possible? How would one go about implementation.

推荐答案

我不认为我问这里有什么实际上可以不必与其他参数的问题进行。相反,林询问正则表达式的新问题,从导入链接重新路由到我的角度URL。

I dont think what I'm asking here can actually be done without having issues with other parameters. Instead Im asking a new question about Regex from incoming links to reroute to my angular URL.

这篇关于可以与UI路由器AngularJS处理多个参数呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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