Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('starter', ['ionic','snackbar'])
- .run(function($ionicPlatform) {
- $ionicPlatform.ready(function() {
- if(window.cordova && window.cordova.plugins.Keyboard) {
- cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
- cordova.plugins.Keyboard.disableScroll(true);
- }
- if(window.StatusBar) {
- StatusBar.styleDefault();
- }
- });
- })
- .controller('AppCtrl', function ($scope, $snackbar) {
- /*
- Feel free to customise this to your hearts content.
- Try out many different combinations to find the right fit for you.
- */
- $scope.Snackbar = function () {
- var options = {
- message: "This is a Snackbar",
- messageColor: "white",
- time: 2000
- }
- $snackbar.show(options);
- }
- $scope.hideFunctionSnackbar = function () {
- var options = {
- message: "This is a Snackbar",
- messageColor: "white",
- buttonName: "Undo",
- buttonFunction: $snackbar.hide(),
- buttonColor: "red",
- time: 5000
- }
- $snackbar.show(options);
- }
- $scope.customFunctionSnackbar = function () {
- var options = {
- message: "This is a Snackbar",
- messageColor: "white",
- buttonName: "Custom",
- buttonFunction: $scope.HelloWorld(),
- buttonColor: "red",
- time: 5000
- }
- $snackbar.show(options);
- }
- $scope.HelloWorld = function () {
- var title = document.getElementById("test");
- angular.element(title).text("Hello World!");
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement