add.js 1.2 KB

12345678910111213141516171819202122232425262728
  1. (function (app) {
  2. app.controller('addCtrl', ["$scope", "$state", "storage", "myService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory"
  3. , function ($scope, $state, storage, myService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory) {
  4. $ionicModal.fromTemplateUrl('my-modal.html', {
  5. scope: $scope,
  6. animation: 'slide-in-up'
  7. }).then(function (modal) {
  8. $scope.modal = modal;
  9. });
  10. $scope.openModal = function () {
  11. $scope.modal.show();
  12. };
  13. $scope.closeModal = function () {
  14. $scope.modal.hide();
  15. };
  16. $scope.$on('$ionicView.beforeEnter', function (viewResult) {
  17. $ionicTabsDelegate.showBar(false);
  18. $ionicNavBarDelegate.showBackButton(true);
  19. });
  20. $scope.$on('$ionicView.leave', function () {
  21. $ionicTabsDelegate.showBar(true);
  22. });
  23. $scope.goback = function () {
  24. $ionicHistory.goBack();
  25. }
  26. }]);
  27. })(angular.module('app.controllers'));