I want to create some circles in an html canvas using angularJS. I know how to do the same using javascript but i am new to angularJS and any help is highly appreciated.
Code:
<title>Home Page</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
</head>
<body>
<div ng-app="myapp" ng-controller="myctrl">
<canvas id="canvas" width="2100" height="900"
style="border: 1px solid #d3d3d3;">
</canvas>
</div>
<script>
var $scope;
var app = angular.module('myapp', []);
myapp.controller("myctrl", function($scope){
var c1 = document.getElementById("canvas");
var ctx = c1.getContext("2d");
ctx.beginPath();
ctx.arc(500, 500, 50, 0, 2 * Math.PI, false);
ctx.lineWidth = 0.2;
ctx.stroke();
ctx.fill();
})
</script>
</body>