1
运行时yeoman server
我希望能够创建URL存根以模拟后端响应。用yeoman服务器St出ajax请求
采取例如以下的控制器:
angularApp.controller('AppuserListCtrl', function ($scope, $http) {
$http({method: 'GET', url: '/admin/appuser/rest/?accept=json'})
.success(function (data, status, headers, config) {
$scope.page = data;
})
.error(function (data, status, headers, config) {
$scope.error = data;
});
});
该控制器依赖于AJAX请求来检索JSON对象做任何工作。 有没有办法将这些与yeoman server
相提并论?
我说的是生产代码,而不是测试。 我选择的是服务器端的CORS,所以我可以在实际的后端使用ajax请求。在使用服务器端请求时,AFAIK没有其他方式与yeoman一起开发。 – javito 2013-02-26 11:24:46