Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
var vm = this;
vm.title = "Subscribe to Updates";
vm.loggedIn = AuthService.validate();
vm.frm = {};
vm.email = null;
// as of now not able to bind the url to view, so it is hard coded in view too
vm.feedBlitzUrl = 'https://www.feedblitz.com/f/f.fbz?AddNewUserDirect';
Expand All @@ -46,18 +47,14 @@
}

function subscribe() {
var params = {
EMAIL: vm.email,
PUBLISHER: vm.feedBlitzPublisher,
FEEDID: vm.feedBlitzFeedId
};
$http.post(vm.feedBlitzUrl, params, {headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}).
success(function(data, status, headers, config) {
console.log("subscribed");
}).
error(function(data, status, headers, config) {
console.log("error in subscription");
});
vm.frm = {};
if (!vm.email || vm.email.trim().length === 0) {
vm.frm.email = {error : true};
$scope.$apply();
return false;
}
$scope.$apply();
return true;
}

}
Expand Down
9 changes: 8 additions & 1 deletion src/js/app/my-dashboard/partials/subscribe-updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
<span class="panel-title">{{vm.title}}</span>
</div>
<div class="panel-body">
<form action="https://www.feedblitz.com/f/f.fbz?AddNewUserDirect" method="POST" name="{{vm.feedBlitzFormName}}">
<form id="subscribe-updates" action="https://www.feedblitz.com/f/f.fbz?AddNewUserDirect" method="POST" name="{{vm.feedBlitzFormName}}" onsubmit="return validateSubscriptionForm();">
<div class="margin-bottom-3x"><span>Enter your Email ID</span></div>
<input type="text" name="EMAIL" placeholder="Email ID" ng-model="vm.email" />
<span class="errorInput" ng-show="vm.frm.email.error">Please fill the email!</span>
<input type="hidden" value="{{vm.feedBlitzPublisher}}" name="PUBLISHER">
<input type="hidden" value="{{vm.feedBlitzFeedId}}" name="FEEDID">
<!-- Workaround to use style attribute to override display css property-->
<input type="submit" class="btn btnAlt margin-top-3x center-block" style="display:block;" value="Subscribe">
</form>
<script type="text/javascript">
function validateSubscriptionForm() {
console.log(angular.element('form#subscribe-updates').scope());
return angular.element('form#subscribe-updates').scope().vm.subscribe();
}
</script>
</div>
</div>