Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Initially when the page load all ui-view loaded and works fine But when i change the state ui-view not getting javascript file that loaded earlier in it's parent page.Although ui view gets the css file but not js file.

In the index.html all three ui-view viewA,viewB,viewC and navbar.html is template of ui-viewA. enter image description here

Here is the state configuration. When i go to studentDashboard the navbar.html loaded but it's js function that define in vendor/all.js doesn't working. enter image description here

Here is the navbar html and controller enter image description here

share|improve this question
    
are you looking fro nested router? – brk Jun 25 '16 at 6:05
    
correct your body tag it has extra > – Piyush.kapoor Jun 25 '16 at 6:05
    
share a screenshot of your navbar and your navbarController code.. – Muthukannan Kanniappan Jun 25 '16 at 6:05
    
Make sure navbarCtrl in navbarController has the correct spelling – Piyush.kapoor Jun 25 '16 at 6:06
    
@user2181397 yes – Muhammad.Nazmul Ahsan Jun 25 '16 at 6:06

You can work around it by converting the js file into a method and render the function inside the ui-view html containing the child page. this approach will work but the downside is when working with directive to inject the sidebar content dynamically. it will require you to duplicate a separate css of same type for each roles and likewise the js too.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.