0

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://www.tutorialspoint.com/viewproject.php?URL=try_angularjs_online.php&PID=0Bw_CjBb95KQMM0lrQXZ6ZmtPa2c

<!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>

1 Answer 1

2

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" 
  }
 }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.