Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('lukaduka-pos', ['ionic'])
- .controller('LukadukaCtrl', function($scope) {
- $scope.tasks = [
- { title: 'Collect coins' },
- { title: 'Eat mushrooms' },
- { title: 'Get high enough to grab the flag' },
- { title: 'Find the Princess' }
- ];
- // Create and load the Modal
- $ionicModal.fromTemplateUrl('new-task.html', function(modal) {
- $scope.taskModal = modal;
- }, {
- scope: $scope,
- animation: 'slide-in-up'
- });
- // Called when the form is submitted
- $scope.createTask = function(task) {
- $scope.tasks.push({
- title: task.title
- });
- $scope.taskModal.hide();
- task.title = "";
- };
- // Open our new task modal
- $scope.newTask = function() {
- $scope.taskModal.show();
- };
- // Close the new task modal
- $scope.closeNewTask = function() {
- $scope.taskModal.hide();
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement