7
Answers

My simple AngularJs code is not running!

Vipin Tyagi

Vipin Tyagi

8y
427
1
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)
Next Recommended Forum