Vipin Tyagi

Vipin Tyagi

  • NA
  • 2k
  • 661.7k

My simple AngularJs code is not running!

May 12 2016 8:32 AM
Hi,
Sorry, I know this is too simple to run a simple Angular code.I also was working on some simple Angular code but this time, I'm stuck that what is happening with my code.
I tried many versions of ng but these are not worthy enough.
I used plnkr.co website to run my  code as I'm staring Angular from very basics. 
I used Sublime text editor but code is not working there. 
 
I used external js file as a controller but no result 
Here is the code:
 
<!DOCTYPE html>
<html >
<head>
<title>MyPage</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.min.js">
</script>
<!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script> -->
<!-- <script type="text/javascript" src="jsfile.js"></script> -->
<!--<script type="text/javascript" src="app.js"></script>-->
<!-- <link rel="stylesheet" type="text/css" href="cssFileDemo.css"> -->
</head>
<body ng-app>
{{8*9}}
<div ng-controller="mainController">
{{message}}
</div>
<script type="text/javascript">
var mainController=function($scope){
$scope.message="Hello";
};
</script>
</body>
</html>
 
 
Plnkr Link:-
 
http://plnkr.co/edit/MLbp6UdAbzaF14xbyRsq?p=preview 
 

Answers (7)