javascript - Angular ui-routing and multiple views in nested child states -


I have an original condition that is abstract, which is basically only the template HTML which contains Yuri-Vision and I have more than one Child states are in which many ideas are included, and in every state of the state there are child states which include many scenes including the first child state in the line I work fine, but when I try to reach the state of child state of the child So it gets crashed Is there.

Here some code is simplified (in my actual code there are many components on the page. It acts like a tud. It is basically a list and an edit scene (I list in the row / Line editing) and editing view will show you the same item, or hide / hide the new item or create new item. I still want to show remaining lists for other components): < P> index.html:

  & lt; Div ui-view & gt; & Lt; / Div & gt; & Lt; Div ui-view = "todo-edit" & gt; & Lt; / Div & gt; & Lt; Div ui-view = "todo-list" & gt; & Lt; / Div & gt;   

js code:

  $ stateProvider .state ('root', {abstract: true, url: '/', templateUrl: '/ index html '}) .state (' root.todo ', {//} This status url works:' / todo ', view: {' :: {template: 'todo list'}, 'todo-list': {templateUrl : '/todo-list.html', Controller: 'TodoListController'}}}) .state ('root.todo.edit', {// This status URL does not work: '/ edit /: id', View: {'@root': {template: 'todo edit'}, 'todo-list @ root': {templateUrl: '/todo-list.html', Controller: 'Todolist Controller'}, 'todo-edit @ root ': {TemplateUrl:' /todo-edit.html ', Controller:' TodoEditController '}}}) .state (' root.todo.create ', {// This status URL does not work:' / create ', thoughts : {'@root': {template: 'todo' create}, 'todo-list @ root': {templateUrl: '/todo-list.html', Controller: 'Todolist Controller'}, 'todo-edit @ root' : {templateUrl: '/todo-edit.html', Controller: 'TodoEditController'}}});   

State todo.list.edit does not work and it will just return me to the root page without any errors. Anyone know what the problem can be and how can it solve it? Any suggestions would be appreciated. Maybe I'm on the wrong track with ideas and there is another way to solve it?

I want to solve various "states" using states, not a service or some simulator.

You are defining the two child states of todo.list :

.state ('todo.list.edit') and .state ('todo.list.create')

But I do not think you Where a state is defined as' todo.list . To work for this, either define the todo.list state or create and edit the 2 states of todo ;

.state ('todo.edit') and .state ('todo.create')

In addition,

todo.list.edit

is not valid because your todo state is actually called root.todo Even if you have todo.list to root.todo.list .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -