<div data-ui-view= "" ></div>
The Data-ui-view here will take
<div ui-view= ""/> The ui-view directive tells $state where to place your templates, you can add name,autoscroll,onload attribute so f Yi.html this is a generic template, to figure out a few names: State,view
For example, there is a state: named Selectedproject, the Templateurl is "selectedproject.html" and then in selectedproject.html ask Price has <div ui-view= ""/ And there are some other parts of the public content that we want to act as selectedproject child templates. State ("Selectedproject.reportlist", {url: "/reportlist", Templateurl: "Reportlist.html", Controller: ' Totalpage '}) such as State:selectedProject.reportList, because A parent-child relationship is formed on the name, so it takes its own template to render the Ui-view part of the parent template.
Therefore, once you want to extract some common parts out, this is a way, the disadvantage is that it to extract a parent state out, so that there will be a state and corresponding template and controller
Question one: So, what if we want to include a common.html in? We don't want to extract the first parent state, because all the sub-routes have changed. Answer: Add the contents of the common section directly to the parent template
Question two: The URL of the child state is written relative to the URL of the parent state, so if the go address is a child state, how do you set the parameter values in the parent state?
The value of href VS ui-sref:ui-sref can be the name of any state of config, and can be used relative to the state name, and can be followed with the value of the parameter, so the combination of ui-router is easy to use Eg:<a Ui-sref= "Contacts.detail ({id:contact.id})" >{{contact.name}}</a>
href is a generic jump link, but does not recognize the custom state name
Use of Angularjs Ui-router