diff --git a/index.html b/index.html index bc78241..b27b603 100644 --- a/index.html +++ b/index.html @@ -56,8 +56,8 @@ - - + + diff --git a/js/app.js b/js/app.js index 338f322..18a70ef 100644 --- a/js/app.js +++ b/js/app.js @@ -117,14 +117,14 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider views: { 'content@': { templateUrl: 'templates/websites.html', - controller: 'ShowsController', + controller: 'websitesCtrl as vm', } } }) .state('app.websites.detail', { url: '/detail/:id', templateUrl: 'templates/websites-detail.html', - controller: 'ShowsDetailController' + controller: 'websitesDetailCtrl as vm' }) .state('app.dns', { url: 'dns', diff --git a/js/controllers/shows-controller.js b/js/controllers/shows-controller.js deleted file mode 100644 index dd148ac..0000000 --- a/js/controllers/shows-controller.js +++ /dev/null @@ -1,3 +0,0 @@ -app.controller('ShowsController', ['$scope','ShowsService', function($scope, ShowsService) { - $scope.shows = ShowsService.list(); -}]); diff --git a/js/controllers/showsDetail-controller.js b/js/controllers/showsDetail-controller.js deleted file mode 100644 index 70cbf2e..0000000 --- a/js/controllers/showsDetail-controller.js +++ /dev/null @@ -1,3 +0,0 @@ -app.controller('ShowsDetailController', ['$scope','$stateParams', 'ShowsService', function($scope, $stateParams, ShowsService) { - $scope.selectedShow = ShowsService.find($stateParams.id); -}]); diff --git a/js/controllers/websites-controller.js b/js/controllers/websites-controller.js new file mode 100644 index 0000000..51dfe88 --- /dev/null +++ b/js/controllers/websites-controller.js @@ -0,0 +1,4 @@ +app.controller('websitesCtrl', ['$scope','ShowsService', function($scope, ShowsService) { + var vm = this; + vm.shows = ShowsService.list(); +}]); diff --git a/js/controllers/websitesDetail-controller.js b/js/controllers/websitesDetail-controller.js new file mode 100644 index 0000000..4ae9786 --- /dev/null +++ b/js/controllers/websitesDetail-controller.js @@ -0,0 +1,4 @@ +app.controller('websitesDetailCtrl', ['$scope','$stateParams', 'ShowsService', function($scope, $stateParams, ShowsService) { + var vm = this; + vm.selectedShow = ShowsService.find($stateParams.id); +}]); diff --git a/templates/websites-detail.html b/templates/websites-detail.html index 87cdc32..1f87e67 100644 --- a/templates/websites-detail.html +++ b/templates/websites-detail.html @@ -1,4 +1,4 @@ -

{{ selectedShow.name }}

+

{{ vm.selectedShow.name }}

- {{ selectedShow.description }} + {{ vm.selectedShow.description }}

diff --git a/templates/websites.html b/templates/websites.html index 00056b4..2eb367b 100644 --- a/templates/websites.html +++ b/templates/websites.html @@ -1,5 +1,5 @@