I can't figure out how to rewrite this AngularJS $http.get to Angular2:
$scope.toggle = function() {
$http.get('http://example.com?operation=getEmployeeData', {
params: {
data: JSON.stringify({
params: {
firstName : 'John',
lastName : 'Doe',
empType : 'Administrative',
orgUnit : 'Management',
lang : 'Eng'
}
})
}
}).then(function(data) { $scope.staff = data }
This how the url with parameters looks like:
http://example.com?operation=getEmployeeData&data={"params":{"firstName":"John","lastName":"Doe","empType":"Administrative","orgUnit":"Management","lang":"Eng"}}
How I do it in Angular2? Thank you!