| .. | .. |
|---|
| 1 | 1 | (function() { |
|---|
| 2 | 2 | 'use strict'; |
|---|
| 3 | | - |
|---|
| 4 | | - var app = angular.module('app', ['ngRoute']); |
|---|
| 5 | 3 | |
|---|
| 6 | | - app.controller('PacksCtrl', ['$scope', '$http', |
|---|
| 7 | | - function($scope, $http) { |
|---|
| 8 | | - |
|---|
| 4 | + var m = angular.module('securis', [ 'ngRoute', 'ngResource', 'toaster', 'localytics.directives', 'catalogs', 'i18n' ]); |
|---|
| 5 | + |
|---|
| 6 | + m.config(function($routeProvider, $locationProvider) { |
|---|
| 7 | + console.log('Configuring routes...'); |
|---|
| 8 | + $routeProvider.when('/login', { |
|---|
| 9 | + templateUrl: 'login.html', |
|---|
| 10 | + controller: 'LoginCtrl', |
|---|
| 11 | + controllerAs: 'login' |
|---|
| 12 | + }); |
|---|
| 13 | + $routeProvider.when('/licenses', { |
|---|
| 14 | + templateUrl: 'licenses.html', |
|---|
| 15 | + controller: 'LicensesCtrl', |
|---|
| 16 | + controllerAs: 'licenses' |
|---|
| 17 | + }); |
|---|
| 18 | + $routeProvider.when('/admin', { |
|---|
| 19 | + templateUrl: 'admin.html', |
|---|
| 20 | + controller: 'AdminCtrl', |
|---|
| 21 | + controllerAs: 'admin' |
|---|
| 22 | + }); |
|---|
| 23 | + |
|---|
| 24 | + // configure html5 to get links working on jsfiddle |
|---|
| 25 | + $locationProvider.html5Mode(true); |
|---|
| 26 | + }); |
|---|
| 27 | + m.controller('MainCtrl', ['$scope', '$location', '$L', |
|---|
| 28 | + function($scope, $location, $L) { |
|---|
| 29 | + console.log('Moving to login...'); |
|---|
| 30 | + console.log('Test 1 lang: ' + 'Hello {0}!! this is {1}'.$i18n('World', 'cool')); |
|---|
| 31 | + console.log('Test 2 lang: ' + $L.get('Hello Pepe!!')); |
|---|
| 32 | + $location.path('/login'); |
|---|
| 9 | 33 | }]); |
|---|
| 10 | 34 | |
|---|
| 11 | | - app.controller('LicensesListCtrl', ['$scope', '$http', |
|---|
| 12 | | - function($scope, $http) { |
|---|
| 13 | | - |
|---|
| 14 | | - }]); |
|---|
| 15 | | - |
|---|
| 16 | | - app.controller('LicenseCtrl', ['$scope', '$http', |
|---|
| 17 | | - function($scope, $http) { |
|---|
| 18 | | - |
|---|
| 19 | | - }]); |
|---|
| 20 | | - |
|---|
| 21 | 35 | |
|---|
| 22 | 36 | })(); |
|---|