controllers.js 789 B

12345678910111213141516171819202122232425262728
  1. angular.module('starter.controllers', [])
  2. .controller('DashCtrl', function($scope) {})
  3. .controller('ChatsCtrl', function($scope, Chats) {
  4. // With the new view caching in Ionic, Controllers are only called
  5. // when they are recreated or on app start, instead of every page change.
  6. // To listen for when this page is active (for example, to refresh data),
  7. // listen for the $ionicView.enter event:
  8. //
  9. //$scope.$on('$ionicView.enter', function(e) {
  10. //});
  11. $scope.chats = Chats.all();
  12. $scope.remove = function(chat) {
  13. Chats.remove(chat);
  14. };
  15. })
  16. .controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
  17. $scope.chat = Chats.get($stateParams.chatId);
  18. })
  19. .controller('AccountCtrl', function($scope) {
  20. $scope.settings = {
  21. enableFriends: true
  22. };
  23. });