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

I have created this Plunker . As can you see this not work. If change the example likes bellow works fine!

.state('home', {
        url: '/home',
        templateUrl: 'controllerView.html',
        controller: 'Controller',
      });


  <head>
<script type="text/javascript" src="https://code.angularjs.org/1.2.13/angular.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.8/angular-ui-router.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/oclazyload/1.0.9/modules/ocLazyLoad.core.min.js"></script>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="controller.js"></script>

The problem is that i want to load controller.js file when user is a specific controller's state and not when is in other state in app. In this example i try to do this, but it doesn't works!

share|improve this question
    
I found the solution!! change to version to ocLazyLoad. from <script type="text/javascript" src="cdnjs.cloudflare.com/ajax/libs/oclazyload/1.0.9/modules‌​/…; go to oldest <script type="text/javascript" src="cdnjs.cloudflare.com/ajax/libs/oclazyload/0.6.3/…; – GomuGomuNoRocket Sep 3 '16 at 20:41

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.