There is a php code
$myArray = array(); $strSQL = "SELECT * FROM mydb.rooms"; $rs =$conn->query($strSQL); while($row = $rs->fetch_array(MYSQLI_ASSOC)) { $MyArray[] = $row; } echo( json_encode(['records'=>($MyArray)])); There is controller.js
.factory('playlistService',function($http) { var playlists = [{idr:1, namer:"Standart"}]; return { playlists:playlists } }); How to add data from php to playlists