angularjs - how to design a state with ui-router that replaces the content only of index.html with two files and two controllers -


how design state ui-router replaces content of index.html 2 files , 2 controllers. have views/dishdetail.html & views/comment.html , i`m trying this:

  .state('app.dishdetail',{         url: 'menu/:id',         views: {             'content@' : {                 'discomment': {                     templateurl : 'views/dishdetail.html',                     controller  : 'dishdetailcontroller'                     },                 'mycomment': {                     templateurl : 'views/comment.html',                     controller  : 'dishcommentcontroller'                     }             }         }      }); 

please help

this should way

    .state('app.dishdetail', {       url: 'menu/:id',       views: {         'content@': {             template: '<div ui-view="discomment" /></div>' +              '<div ui-view="mycomment" /></div>',           },           'discomment@app.dishdetail': {             templateurl: 'views/dishdetail.html',             controller: 'dishdetailcontroller'           },           'mycomment@app.dishdetail': {             templateurl: 'views/comment.html',             controller: 'dishcommentcontroller'           }       } 

there a working plunker


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -