The below cade is working for Angularjs 1 but i am not able to findout the proper code for angularjs2
<script type="text/javascript">
var app = angular.module('myApp', ['lr.upload']);
app.controller('HomeCtrl', ['$scope', 'upload', '$http', function ($scope, upload, $http) {
$scope.doUpload = function () {
upload({
url: 'Home/upload',
method: 'POST',
data: {
aFile: $scope.myFile
}
}).then(
function (response) {
console.log(response.data);
},
function (response) {
console.error(response);
}
);
}
} ])