I am new to Angular 2, I want to migrate this code from Angular 1 to Angular2, could you please give me an idea of how to do it.
// Forgot Password
$scope.passwordDialog = function($event) {
prompty({
title: 'Password Recovery',
label: 'Enter your email address',
type: 'email',
submitText: 'Send',
required: true,
event: $event
})
.then(function(email) {
return superlogin.forgotPassword(email);
})
.then(function() {
toasty('Check your email!');
}, function(err) {
if(err) {
console.error(err);
toasty(err.error);
}
});
};