aboutsummaryrefslogtreecommitdiff
path: root/app/js/controllers.js
blob: df097b595e1d6c8b1f4667238952020177842987 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';

/* Controllers */
var p = new Point(1,2);



app.controller('pointCtrl', function($scope, $http, pathService){

	$scope.points=dummyPoints;
	$scope.line = [];

	var update = function(newPoints, newLine) {
		if(newLine.length > 0) {
			$scope.playseq=pathService.computePlaylist(newPoints, newLine, 60);
		}
	}

	$scope.$watch('points', function(newVal, oldVal) {
		console.log("r")
		update(newVal, $scope.line);
    }, true);

    $scope.$watch('line', function(newVal) {
		update($scope.points, newVal);
    }, true);
	

//	$scope.line=constList;
	
	$scope.addNewSongToGraph(id, titre, link, duration)
	{
		
	}
	

	$scope.getColor = function(point) {
		if (playlist.indexOf(point) == -1) {
			return "white"
		} else {
			return "red"
		}
	}

	$scope.foo = function (event) {
		console.log("foobar");

		$scope.points.push({
			x: 250,
			y: 250
		});
	};


});