search

Home  >  Q&A  >  body text

angular.js - Problems with the default address bar of ui-sref

I was looking at a small example of angular bookstore by Teacher Da Mo, and found a problem when implementing ui-sref

<a ui-sref="booklist({bookType:0})" class="list-group-item">计算机</a>

At this time, the address bar displays something like http://localhost:8080/#/0
and another line of code

<a ui-sref="bookdetail({bookId:row.getProperty(col.field)})" id="{{row.getProperty(col.field)}}">详情</a>

The display is like this http://localhost:8080/#/bookd...

So my question is why the booklist in the ui-sref in the above line is omitted in the address bar, but the details can be

I checked some official documents of ui-router about the $state.href method. Examples are as follows:
expect($state.href("about.person", { person: "bob" })).toEqual( "/about/bob");

大家讲道理大家讲道理2817 days ago554

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-15 17:10:28

    Routing url configuration problem

    If you write like this, the first option will be there

    reply
    0
  • Cancelreply