search

Home  >  Q&A  >  body text

angular.js - Problems encountered when learning ui-router

I was using ui-router to make something recently and encountered a problem. The file directory is as follows


The following is the index.htmlui-view in

The following is the routing configuration in app.js

The current url is like this:

Now I want to click 排名 to change the web page URL to this

The following is the code in mainPage.html


But after I clicked on the ranking, I got this error:

I feel confused, please help me check it out, thank you

过去多啦不再A梦过去多啦不再A梦2825 days ago562

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-15 17:01:48

    The value of

    ui-sref should be the defined state, and

    should be placed on the page
    ui-sref = "#/mRange"

    was modified to

    ui-sref = "mRange"

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-15 17:01:48

    Remove #/ in ui-sref

    reply
    0
  • Cancelreply