Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. angular.module('starter', ['ionic','snackbar'])
  2.  
  3. .run(function($ionicPlatform) {
  4. $ionicPlatform.ready(function() {
  5. if(window.cordova && window.cordova.plugins.Keyboard) {
  6. cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  7. cordova.plugins.Keyboard.disableScroll(true);
  8. }
  9. if(window.StatusBar) {
  10. StatusBar.styleDefault();
  11. }
  12. });
  13. })
  14.  
  15. .controller('AppCtrl', function ($scope, $snackbar) {
  16.  
  17. /*
  18. Feel free to customise this to your hearts content.
  19. Try out many different combinations to find the right fit for you.
  20. */
  21.  
  22. $scope.Snackbar = function () {
  23. var options = {
  24. message: "This is a Snackbar",
  25. messageColor: "white",
  26. time: 2000
  27. }
  28. $snackbar.show(options);
  29. }
  30.  
  31. $scope.hideFunctionSnackbar = function () {
  32. var options = {
  33. message: "This is a Snackbar",
  34. messageColor: "white",
  35. buttonName: "Undo",
  36. buttonFunction: $snackbar.hide(),
  37. buttonColor: "red",
  38. time: 5000
  39. }
  40. $snackbar.show(options);
  41. }
  42.  
  43. $scope.customFunctionSnackbar = function () {
  44. var options = {
  45. message: "This is a Snackbar",
  46. messageColor: "white",
  47. buttonName: "Custom",
  48. buttonFunction: $scope.HelloWorld(),
  49. buttonColor: "red",
  50. time: 5000
  51. }
  52. $snackbar.show(options);
  53. }
  54.  
  55. $scope.HelloWorld = function () {
  56. var title = document.getElementById("test");
  57. angular.element(title).text("Hello World!");
  58. }
  59.  
  60. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement