angularjs - Angular ui Router views not working -


my code ui router not working if set partial page view , name. please see code below.

html: using tab parent state.

 <ul class="sidebar-nav">                <li>             <a ui-sref=".timeline" name="timeline-tab"><div class="chap-title">chap1</div></a>         </li>         <li>             <a ui-sref=".chap2" name="chap2-tab"><div class="chap-title">chap2</div></a>         </li>   </ul> <div ui-view></div> 

and angular ui router:

//chap1 page       .state('tab.timeline', {         url: '/timeline',             templateurl: 'partials/chap1_timeline.html',             controller: 'timelinecontroller'       })  //chapter 2      .state('tab.chap2', {         url:'/chap2',         views:{           'chap2-tab':{             templateurl:'partials/chap2_scroll.html',             controller:'chap2controller'           }         }       }) 

the router chap1 works perfectly. it's not working chap2 when add view. dont know have missing according tutorial

the problem chap2 whole page content/controller not loading. no error msg, no content

why using name instead of "state"?

change code below , see if works.

      //chap1 page       .state('tab.timeline', {         url: '/timeline',             templateurl: 'partials/chap1_timeline.html',             controller: 'timelinecontroller'       })      //chapter 2          .state('tab.chap2', {             url:'/chap2',             views:{               '.chap2':{                 templateurl:'partials/chap2_scroll.html',                 controller:'chap2controller'               }             }           }) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -