Advertisement
Guest User

Untitled

a guest
Jun 18th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <button class="button button-dark" ng-click="showAlert()">Sample Alert</button>
  2.  
  3. .controller('PopupCtrl', function($scope, $timeout, $q, $ionicPopup) {
  4. $scope.showAlert = function() {
  5. var alertPopup = $ionicPopup.alert({
  6. title: 'Don't eat that!',
  7. template: 'It might taste good'
  8. });
  9. alertPopup.then(function(res) {
  10. console.log('Thank you for not eating my delicious ice cream cone');
  11. });
  12. };
  13. })
  14.  
  15. Error: $ionicPopup is not defined
  16. $scope.showAlert@http://localhost:8100/js/controllers.js:20:13
  17. $parseFunctionCall@http://localhost:8100/lib/ionic/js/ionic.bundle.js:21044:15
  18. @http://localhost:8100/lib/ionic/js/ionic.bundle.js:53458:9
  19. $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8100/lib/ionic/js/ionic.bundle.js:23100:16
  20. $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8100/lib/ionic/js/ionic.bundle.js:23199:18
  21. @http://localhost:8100/lib/ionic/js/ionic.bundle.js:53457:7
  22. createEventHandler/eventHandler@http://localhost:8100/lib/ionic/js/ionic.bundle.js:11713:9
  23. triggerMouseEvent@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2863:3
  24. tapClick@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2852:3
  25. tapMouseUp@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2925:5
  26.  
  27.  
  28. return logFn.apply(console, args);
  29.  
  30. <link href="css/ionic.app.css" rel="stylesheet">
  31. <script src="lib/ionic/js/ionic.bundle.js"></script>
  32. <script src="cordova.js"></script>
  33.  
  34. .controller('PopupCtrl', popupCtrl);
  35.  
  36. popupCtrl.$inject = ['$scope', '$timeout', '$q', '$ionicPopup'];
  37.  
  38. var popupCtrl = function($scope, $timeout, $q, $ionicPopup) {
  39. $scope.showAlert = function() {
  40. var alertPopup = $ionicPopup.alert({
  41. title: 'Don't eat that!',
  42. template: 'It might taste good'
  43. });
  44. alertPopup.then(function(res) {
  45. console.log('Thank you for not eating my delicious ice cream cone');
  46. });
  47. };
  48. }
  49.  
  50. .controller('PopupCtrl', ['$scope', '$timeout', '$q', '$ionicPopup', function($scope, $timeout, $q, $ionicPopup) {
  51. $scope.showAlert = function() {
  52. var alertPopup = $ionicPopup.alert({
  53. title: 'Don't eat that!',
  54. template: 'It might taste good'
  55. });
  56. alertPopup.then(function(res) {
  57. console.log('Thank you for not eating my delicious ice cream cone');
  58. });
  59. };
  60. }])
  61.  
  62. angular.module('surveyApp', ['ionic'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement