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