그래서 예를 들어 나는 모든 정보와 함께 주요 배열을 나는 필요합니다배열 요소를 다른 배열에 포함시키는 방법은 무엇입니까?
$scope.songs = [
{ title: 'Reggae', url:"#/app/mworkouts", id: 1 },
{ title: 'Chill', url:"#/app/browse", id: 2 },
{ title: 'Dubstep', url:"#/app/search", id: 3 },
{ title: 'Indie', url:"#/app/search", id: 4 },
{ title: 'Rap', url:"#/app/mworkouts", id: 5 },
{ title: 'Cowbell', url:"#/app/mworkouts", id: 6 }
];
내가 최종 결과가
같이 있도록 각 개체에 입력하지 않고 다른 배열에 특정 물건을 올려 싶어$scope.array1 = [
{ title: 'Reggae', url:"#/app/mworkouts",id: 1 },
{ title: 'Cowbell', url:"#/app/mworkouts",id: 6 }
];
이
내가 행운과 함께이 시도했다 :
$scope.array1 = [
{ $scope.songs[1] },
{ $scope.songs[6] }
];
내가 이렇게 각 개체에 입력하는 것은 영원히 걸릴 이들의 무리를해야 할 것입니다 이 작업을 수행하는 더 빠른 방법이 있습니까? 미리 감사드립니다 :)
'$ scope.array1 = [ $ scope.songs [1], $ scope.songs을 [6] ]; ' –
굉장! 올바른 구문을 알지 못하는데 ... 다시 한 번 감사드립니다! – MehdiN