search

Home  >  Q&A  >  body text

angular.js - AngularJS怎么获取到上一个页面的两个参数值?

用$routeParams.id;只能获取到一个,第二个获取不到

过去多啦不再A梦过去多啦不再A梦2744 days ago526

reply all(3)I'll reply

  • 某草草

    某草草2017-05-15 17:11:25

    Anyway, you should also post a section of the router's relevant configuration file, and then I can tell you to add a field to the route? The ending can be passed on or not.
    23333

    'path/:id/:params?'

    This is the best way.

    The following is a bad way, it can be anything messy like creating a shared service or passing cookie parameters,

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 17:11:25

    See the parameter passing section of ui-route.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:11:25

    If the route is url: '/smart_accounting/invoice/preCertificate/detail/:id/:type',
    then get
    $stateParams.id
    $stateParams.type

    reply
    0
  • Cancelreply