Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidmaogomezz/a303ad2e890afc34efa4 to your computer and use it in GitHub Desktop.
Save davidmaogomezz/a303ad2e890afc34efa4 to your computer and use it in GitHub Desktop.
Ionic : Sample Alert : Forum 2165
<html ng-app="ionic.example">
<head>
<meta charset="utf-8">
<title>Popups</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="http://code.ionicframework.com/nightly/css/ionic.min.css" rel="stylesheet">
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
</head>
<body ng-controller="PopupCtrl">
<button class="button button-dark" ng-click="showAlert()">Sample Alert</button>
<script id="popup-template.html" type="text/ng-template">
<input ng-model="data.wifi" type="text" placeholder="Password">
</script>
</body>
</html>
angular.module('ionic.example', ['ionic'])
.controller('PopupCtrl', function($scope, $timeout, $q, $ionicPopup) {
$scope.showAlert = function() {
$ionicPopup.alert({
title: 'Success',
content: 'Hello World!!!'
}).then(function(res) {
console.log('Test Alert Box');
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment