angularjs - Submenu in submenu using ui-router -


hello i'm trying submenu in submenu using ui-route. im trying in angular v1.

->folders

---->jobs

------->coder

------->chef

folder it's menu, jobs it's sub menu , coder , chef it's options inside of submenu of coder

here code

$stateprovider .state('folders', { url: '/app/folders', template : '', abstract: true, controller: "foldersctrl",  title: 'folders',   sidebarmeta: {     icon: 'ion-grid',     order: 1,   }, }).state('jobs', {   url: '/jobs',   abstract: true,   title: 'jobs', }) .state('jobs.coder', {   parent: 'jobs',   url: '/coder',   title: 'coder',   sidebarmeta: {     order: 0,   }, }).state('jobs.chef', {   parent: 'chef',   url: '/jobs',   title: 'chef',   sidebarmeta: {     order: 0,   }, }); } 

but code show me this

->folders --->jobs --->coder --->chef 

any idea or sugestion submenu in submenu using ui-route?

you've make changes in state names. make folders, folders.jobs, jobs.coder, jobs.chef respectively , remove parent property coder & chef state. careful using parent property, should have value defined in state name dot notification (so last 1 parent should jobs if statename jobs.chef).

checkout plunker similar nested view implementation: https://plnkr.co/edit/f5upm3esjd40qq1e3nwx?p=preview

also if you're defining state abstract need have ui-view tag element in template, because that's child states gonna load. checkout plunker that: http://plnkr.co/edit/gmtce2?p=preview

also take @ ui-router official documentation ways & structure nested view implementation explained.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -