Skip to content

Instantly share code, notes, and snippets.

@jhenriquez
Created August 7, 2015 20:23
Show Gist options
  • Save jhenriquez/27a3f104462a67d87372 to your computer and use it in GitHub Desktop.
Save jhenriquez/27a3f104462a67d87372 to your computer and use it in GitHub Desktop.
JavaScript Clousures At Their Finest? :p
$scope.openEditFeatureDialog = function (feature) {
ngDialog.openConfirm({
template: '/js/angular/Templates/Admin/addSubscriptionFeature.html',
controller: function($scope) {
$scope.description = feature.description;
$scope.emphasize = feature.emphasize;
$scope.add = function () {
if (!$scope.description) {
return $scope.descriptionHasError = true;
}
$scope.confirm({
description: $scope.description,
emphasize: $scope.emphasize
});
};
}
}).then(function (updatedFeature) {
feature.description = updatedFeature.description;
feature.emphasize = updatedFeature.emphasize;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment