javascriptjqueryangularjsangularjs-directiveangularjs-scope

why the view not display on angular js?


I am trying to display a view using angular js using module form .could you please tell me why it is not display my view or page I share my code on this link http://goo.gl/ocBdQ5

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="css/foundation.css" />
    <script src="lib/angular.js" type="text/javascript"></script>

    <script src="lib/angular-ui-router.js" type="text/javascript"></script>
     <script src="js/firtdir/module.js" type="text/javascript"></script>
     <script src="js/firtdir/router.js" type="text/javascript"></script>
       <script src="js/firtdir/controller/firstcontroller.js" type="text/javascript"></script>
    <script src="js/app.js" type="text/javascript"></script>
</head>

<body >
     <div ng-app="firstApp">
         <div ui-view="app"></div>
     </div>


</body>

</html>

Solution

  • I have fixed the following issues and now your sample is working.

    index.html >> Directory name is corrected as "firstdir" in url

    Routes >> controller should be inside views as follows

    $stateProvider.state('app', {
     url: '/app',
     views:{
      app: 
      {
            templateUrl: 'js/firstdir/templates/firstpage.html', 
            controller:"firstcont" 
      }
     }
    });