in cakephp I have some data encoded to json ( like this: $projects= json_encode($projects); ) but my php controller returnet wrong data mode! my json returned data is in "[ ]" and i cant access to this form of data in angular ng-repeat for view! what is the matter?
here is some parts of my cakephp controller:
public function admin_getprojects()
{
$projects = $this->Project->find('all',array(
'contain'=>array('UsersProjects'=>array('User'),
'Task')
));
$this->set('projects', $projects);
$projects= json_encode($projects);
echo $projects;
exit();
}
returned data: view of json data in json parser... this shouldn't have "[" and "]" at begin and end