As reference, here is what my compiled app.js looks like:
(function() {
‘use strict’;
angular.module('test-mobile', ['ngRoute', 'ionic', 'restangular', 'test-mobile-chat', 'templates'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
.config(function($routeProvider) {
$routeProvider
.otherwise({
redirectTo: '/chat'
});
});
})();
(function() {
‘use strict’;
console.log('chat module');
angular.module('test-mobile-chat', ['ngRoute', 'ionic', 'restangular'])
.config(function($stateProvider, $urlRouterProvider) {
console.log('config');
$stateProvider
.state('chat', {
url: "/chat",
abstract: true,
templateUrl: 'chat/chat.html',
controller: 'ChatCtrl'
});
}).controller('ChatCtrl', function($scope) {
$scope.awesomeThings = [
'Nolan',
'Kirsten',
'Sadie',
'Nyla'
];
console.log('chat controller loaded', $scope.awesomeThings);
});
})();
(function() {
‘use strict’;
angular.module('test-mobile-main', ['ngRoute', 'ionic', 'restangular'])
.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'main/main.html',
controller: 'MainCtrl'
});
})
.controller('MainCtrl', function($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
});
})();