I am completely new to ionic2/Angular2/Typescript. I am creating a wheel having eight slices. I have difficulty in declaration of variables. How do I declare multiple variables?
In javascript I have declared like below:
function rand(min, max) {
return Math.random() * (max - min) + min;
}
var color = ['#fbc','#f88','#fbc','#f88','#fbc','#f88', "#fbc", "#f67"];
var label = ['10', '200', '50', '100', '5', '500', '0', "jPOT"];
var slices = color.length;
var sliceDeg = 360/slices;
var deg = rand(0, 360);
var speed = 0;
var slowDownRand = 0;
var ctx = canvas.getContext('2d');
var width = canvas.width; // size
var center = width/2; // center
var isStopped = false;
var lock = false;
function deg2rad(deg) {
return deg * Math.PI/180;
}
How do I declare in ionic2 ?
vartoo but there is typeletthat you can use for local scope