mercredi 26 octobre 2016

Angular JS, alert True or False

I have included a checkbox, when I click on the checkbox, the alert pop up is displaying. If I click on Ok in alert pop up, than it has to replace the checkbox completely and keep true in place of that

How can we show that in Angular JS?

angular.module('app', [])
.controller('alertsMesssageCtrl', ['$scope', function($scope) {
$scope.onalertClick = function(alert) {
  var box = confirm("Are you sure you want to do this?");

  if (box === false) { // yes sure
    alert.alertType = !alert.alertType;
    return true;
  }else{

  }
};




Aucun commentaire:

Enregistrer un commentaire