Load duplicates
This commit is contained in:
parent
b8532dbf09
commit
809997b34b
2 changed files with 23 additions and 4 deletions
|
@ -1,2 +1,8 @@
|
|||
<p>UID: {{uid}}</p>
|
||||
<p>ID: {{id}}</p>
|
||||
<h2>Results</h2>
|
||||
<div ng-if="loaded == false">Loading...</div>
|
||||
<div ng-if="tracks.length == 0 && loaded">No duplicates found</div>
|
||||
<div ng-if="tracks.length > 0 && loaded">
|
||||
<div class="list-group-item" ng-repeat="t in tracks">
|
||||
{{t.track.name}} - <span ng-repeat="artist in t.track.artists">{{artist == t.track.artists[0]?'':', '}}{{artist.name}}</span>
|
||||
</div>
|
||||
</div>
|
|
@ -88,10 +88,23 @@
|
|||
$scope.load();
|
||||
}]);
|
||||
|
||||
app.controller("DupsCtrl",['$scope', '$stateParams',function($scope, $stateParams){
|
||||
app.controller("DupsCtrl",['$scope', '$stateParams', '$http',function($scope, $stateParams, $http){
|
||||
$scope.uid = $stateParams['uid'];
|
||||
$scope.id = $stateParams['id'];
|
||||
|
||||
$scope.tracks = [];
|
||||
$scope.loaded = false;
|
||||
$scope.load = function () {
|
||||
$http.get('/pl/' + $scope.uid + '/' + $scope.id, {
|
||||
params: {
|
||||
access_token: $scope.access_token
|
||||
}
|
||||
}).then(function(result) {
|
||||
var r = result.data;
|
||||
$scope.tracks = r.data;
|
||||
$scope.loaded = true;
|
||||
});
|
||||
};
|
||||
$scope.load();
|
||||
}]);
|
||||
|
||||
app.controller('AuthCtrl',['$scope', '$rootScope', '$interval', '$http', function($scope, $rootScope, $interval, $http){
|
||||
|
|
Loading…
Reference in a new issue