var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope,$http) {
$scope.name = 'World';
function MyClass() {
this.setMyField = function(value) {
this.value = value;
}
}
myClass = new MyClass();
myClass.setMyField('a-value');
var request = {
method : 'GET',
url : '/outerspace/',
params : myClass
};
$http(request);
});
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css" />
<script data-require="angular.js@1.5.x" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.11/angular.min.js" data-semver="1.5.11"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<p>Hello {{name}}!</p>
</body>
</html>
/* Put your css in here */