Advertisement
Guest User

app.js

a guest
Feb 24th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('lukaduka-pos', ['ionic'])
  2.  
  3. .controller('LukadukaCtrl', function($scope) {
  4.   $scope.tasks = [
  5.     { title: 'Collect coins' },
  6.     { title: 'Eat mushrooms' },
  7.     { title: 'Get high enough to grab the flag' },
  8.     { title: 'Find the Princess' }
  9.   ];
  10.  
  11.     // Create and load the Modal
  12.     $ionicModal.fromTemplateUrl('new-task.html', function(modal) {
  13.         $scope.taskModal = modal;
  14.     }, {
  15.         scope: $scope,
  16.         animation: 'slide-in-up'
  17.     });
  18.  
  19.     // Called when the form is submitted
  20.     $scope.createTask = function(task) {
  21.         $scope.tasks.push({
  22.           title: task.title
  23.         });
  24.         $scope.taskModal.hide();
  25.         task.title = "";
  26.     };
  27.  
  28.     // Open our new task modal
  29.     $scope.newTask = function() {
  30.         $scope.taskModal.show();
  31.     };
  32.  
  33.     // Close the new task modal
  34.     $scope.closeNewTask = function() {
  35.         $scope.taskModal.hide();
  36.     };
  37.    
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement