creating basic controllers
This commit is contained in:
parent
7e34253495
commit
7bef363585
9 changed files with 100 additions and 30 deletions
10
js/app.js
10
js/app.js
|
|
@ -3,8 +3,16 @@
|
|||
angular.module('cosign',[
|
||||
'ngRoute',
|
||||
'ui.bootstrap',
|
||||
'cosign.header'
|
||||
'cosign.header',
|
||||
'cosign.home',
|
||||
'cosign.transactions',
|
||||
'cosign.send',
|
||||
'cosign.backup'
|
||||
]);
|
||||
|
||||
angular.module('cosign.header', []);
|
||||
angular.module('cosign.home', []);
|
||||
angular.module('cosign.transactions', []);
|
||||
angular.module('cosign.send', []);
|
||||
angular.module('cosign.backup', []);
|
||||
|
||||
|
|
|
|||
15
js/config.js
15
js/config.js
|
|
@ -6,11 +6,18 @@ angular
|
|||
.config(function($routeProvider) {
|
||||
|
||||
$routeProvider
|
||||
.when('/signin', {
|
||||
.when('/', {
|
||||
templateUrl: 'home.html'
|
||||
}).when('/transactions', {
|
||||
templateUrl: 'transactions.html'
|
||||
}).when('/send', {
|
||||
templateUrl: 'send.html'
|
||||
}).when('/backup', {
|
||||
templateUrl: 'backup.html'
|
||||
}).when('/signin', {
|
||||
templateUrl: 'signin.html'
|
||||
})
|
||||
.when('/home', {
|
||||
templateUrl: 'home.html'
|
||||
}).otherwise({
|
||||
templateUrl: '404.html'
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
6
js/controllers/backup.js
Normal file
6
js/controllers/backup.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('cosign.backup').controller('BackupController',
|
||||
function($scope, $rootScope, $location) {
|
||||
$scope.title = 'Backup';
|
||||
});
|
||||
|
|
@ -2,7 +2,27 @@
|
|||
|
||||
angular.module('cosign.header').controller('HeaderController',
|
||||
function($scope, $rootScope, $location) {
|
||||
$scope.menu = [{
|
||||
'title': 'Home',
|
||||
'link': '#/'
|
||||
}, {
|
||||
'title': 'Transactions',
|
||||
'link': '#/transactions'
|
||||
}, {
|
||||
'title': 'Send',
|
||||
'link': '#/send'
|
||||
}, {
|
||||
'title': 'Backup',
|
||||
'link': '#/backup'
|
||||
}];
|
||||
|
||||
$scope.isActive = function(item) {
|
||||
if (item.link.replace('#','') == $location.path()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.init = function() {
|
||||
$rootScope.isLogged = false;
|
||||
};
|
||||
|
|
|
|||
6
js/controllers/home.js
Normal file
6
js/controllers/home.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('cosign.home').controller('HomeController',
|
||||
function($scope, $rootScope, $location) {
|
||||
$scope.title = 'Home';
|
||||
});
|
||||
6
js/controllers/send.js
Normal file
6
js/controllers/send.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('cosign.send').controller('SendController',
|
||||
function($scope, $rootScope, $location) {
|
||||
$scope.title = 'Send';
|
||||
});
|
||||
6
js/controllers/transactions.js
Normal file
6
js/controllers/transactions.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('cosign.transactions').controller('TransactionsController',
|
||||
function($scope, $rootScope, $location) {
|
||||
$scope.title = 'Transactions';
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue