Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Master/detail logic implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed Oct 1, 2015
1 parent deb293c commit 1dbce10
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/app/dashboard/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!function($, jQuery, window, document) {
!function ($, jQuery, window, document) {
'use strict';

/**
Expand Down
1 change: 1 addition & 0 deletions app/app/gameDetail/gameDetail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Detail: {{gameId}}
16 changes: 16 additions & 0 deletions app/app/gameDetail/gameDetail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!function ($, jQuery, window, document) {
'use strict';

/**
* @public
* @constructor
*
* @param $scope
* @param $stateParams
*/
function GameDetailController($scope, $stateParams) {
$scope.gameId = $stateParams.gameId;
}

app.module.controller('gameDetailController', GameDetailController);
}();
1 change: 1 addition & 0 deletions app/app/gameList/gameList.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
List
15 changes: 15 additions & 0 deletions app/app/gameList/gameList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
!function ($, jQuery, window, document) {
'use strict';

/**
* @public
* @constructor
*
* @param $scope
*/
function GameListController($scope) {

}

app.module.controller('gameListController', GameListController);
}();
3 changes: 2 additions & 1 deletion app/app/init.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
!function($, jQuery){
'use strict';

window.app = window.app || {};
window.app.module = angular.module('basta-sample', ['ui.router', 'pascalprecht.translate', 'ngSanitize']);

FastClick.attach(document.body);

}();
}();
30 changes: 18 additions & 12 deletions app/app/routing.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
!function($, jQuery){

!function($, jQuery, window, document) {
'use strict';

app.module.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('dashboard', {
url: '/',
views: {
'main@': {
templateUrl: 'app/dashboard/dashboard.html',
controller: 'dashboardController'
}
}
});
.state('dashboard', getState('dashboard', '/'))
.state('gameList', getState('gameList', '/games'))
.state('gameDetail', getState('gameDetail', '/games/:gameId'));

$urlRouterProvider.otherwise('/');
});

}();
function getState(name, url) {
return {
url: url || '/' + name,
views: {
'main@': {
templateUrl: 'app/' + name + '/' + name + '.html',
controller: name + 'Controller'
}
}
};
}
}();
2 changes: 2 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ <h3 class="control-sidebar-heading" translate="sidebar.language"></h3>
<script src="app/config.js"></script>
<script src="app/routing.js"></script>
<script src="app/dashboard/dashboard.js"></script>
<script src="app/gameDetail/gameDetail.js"></script>
<script src="app/gameList/gameList.js"></script>
<script src="app/common/controllers/language.js"></script>
</body>
</html>

0 comments on commit 1dbce10

Please sign in to comment.