<!DOCTYPE HTML>
<html ng-app>
<head>
<title>Test of Angular/PHP</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script type="text/javascript" src="controllers/task_list_controller.js"></script>
</head>
<body>
<h1>Tasks in Task Table</h1>
<div ng-controller="taskListCtrl">
<ul>
<li>
This is using a controller: {{tasks}}
<br />
This is using the direct php:
<?php echo 'test'; ?>
</li>
</ul>
</div>
</body>
</html>
in the task_list_controller.js file I have:
function taskListCtrl ($scope) {
$scope.tasks = <?php echo 'test';?>
}
Why doesn't his work? What might I be doing wrong? What do I need to do so that I can pass data from PHP to an angular controller?
Thanks,