diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/application.jsp b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/application.jsp
index 6f5eac784..3f6c374c0 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/application.jsp
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/content/application.jsp
@@ -16,7 +16,7 @@
Home - Projects
-
+
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js
index 513760ca7..9b93aaba7 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/config.js
@@ -30,10 +30,10 @@
$routeProvider.when('/projects', {
templateUrl: 'partials/projects.html',
- controller: 'ApacheProjectsController'
+ controller: 'ApacheProjectsController as vm'
}).when('/home', {
templateUrl: 'partials/home.html',
- controller: 'HomeController'
+ controller: 'HomeController as vm'
}).otherwise({ redirectTo: '/home' });
}
]);
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js
index 096e3da5d..1fb0ca960 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/ApacheProjectsController.js
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -25,15 +23,18 @@
.module('app')
.controller('ApacheProjectsController', ApacheProjectsController);
- function ApacheProjectsController($scope, $log, DataService) {
- this.init = function() {
- DataService.getProjects().then(function(data) {
- $scope.projects = data.projectNames;
+ function ApacheProjectsController($log, DataService) {
+ var vm = this;
+
+ init();
+
+ function init() {
+ return DataService.getProjects().then(function(data) {
+ vm.projects = data.projectNames;
+ return vm.projects;
}, function() {
$log.error('Could not receive project names.');
});
- };
-
- this.init();
+ }
}
})();
\ No newline at end of file
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js
index 0f1bc2d5a..d6de31a7a 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/AppController.js
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -22,8 +20,8 @@
'use strict';
angular
- .module('app')
- .controller('AppController', AppController);
+ .module('app')
+ .controller('AppController', AppController);
function AppController() {
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js
index d0f23e35c..44c7cf9af 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/js/controllers/HomeController.js
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -25,7 +23,8 @@
.module('app')
.controller('HomeController', HomeController);
- function HomeController($scope) {
- $scope.name = "Sunshine";
+ function HomeController() {
+ var vm = this;
+ vm.name = "Sunshine";
}
})();
\ No newline at end of file
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/home.html b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/home.html
index f147d6eb2..239f4ea1a 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/home.html
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/home.html
@@ -1,6 +1,6 @@
-
Hello, {{name}}.
+
Hello, {{vm.name}}.
Not your name?
-
+
\ No newline at end of file
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/projects.html b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/projects.html
index ac0f65e60..12f46550f 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/projects.html
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/src/main/webapp/partials/projects.html
@@ -1,3 +1,3 @@