As I've asked in my last question here I try to write an angularJs client to consume symfony2 restful api. This is my angular module :
var app = angular.module('myApp', ['ngRoute']);
app.factory("services", ['$http', function($http) {
var serviceBase = '/myproject/web/app_dev.php/api/';
var obj = {};
obj.getCategories = function(){
return $http.get(serviceBase + 'categories');
}
obj.getCategorie = function(CostumerID){
return $http.get(serviceBase + 'costumer?id=' + CostumerID);
}
obj.deleteCostumer = function (id) {
return $http.delete(serviceBase + 'deleteCostumer?id=' + id).then(function (status) {
return status.data;
});
};
return obj;
}]);
app.controller('listCtrl', function ($scope, services) {
services.getCategories().then(function(data){
$scope.categorie = data.data;
});
});
I have created an index page :
<!DOCTYPE html>
<html data-ng-app="myApp" ng-app lang="en">
<head>
<meta charset="utf-8">
<link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div>
<div class="container">
<div data-ng-view="" id="ng-view"></div>
</div>
</div>
<script src="/angular/angular.min.js"></script>
<script src="/app/app.js"></script>
</body>
</html>
I found that I can use FOSJsRoutingBundle to generate route for my app but in the documentation I should add this two line to my code :
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {'callback': 'fos.Router.setData'}) }}"></script>
But I don't use twig and I don't know hwo can I use it?
Also I don't know which url should I ask at first time to run the application because when I ask for index I have a blank page :(
Can someone help me and tell me what should I do or what I've missed?
$httprequest from angular.