.controller('Ctrlajax', ['$scope', 'version','$sce', '$resource', '$http',
function ($scope, version,$sce,$resource,$http) {
$scope.answer = 'Waiting for response from the server.....';
require('ajax_module');
}])
ajax_module.js
define('ajax_module',['angular'],function($http){
var path = './././data/'
$http.get(path+'res.php').success(function(data){
debugger
$scope.answer = data;
});
})
Error:Uncaught TypeError: undefined is not a function How can $scope and $http be passed?