aboutsummaryrefslogtreecommitdiffstats
path: root/example/personalLog/personalLog.js
diff options
context:
space:
mode:
authorIgor Minar2012-03-28 10:50:46 -0700
committerMisko Hevery2012-03-28 11:24:47 -0700
commitba59ef495007d192724b352c68e7d2edc53f8b63 (patch)
tree6609f89fb6c1c349a2725926e137a30fbd76209e /example/personalLog/personalLog.js
parent8b93541522161e16ddd606770732d176c4bf0eec (diff)
downloadangular.js-ba59ef495007d192724b352c68e7d2edc53f8b63.tar.bz2
docs(examples): update example apps
Diffstat (limited to 'example/personalLog/personalLog.js')
-rw-r--r--example/personalLog/personalLog.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/example/personalLog/personalLog.js b/example/personalLog/personalLog.js
index 4d182227..c22b8702 100644
--- a/example/personalLog/personalLog.js
+++ b/example/personalLog/personalLog.js
@@ -5,28 +5,23 @@
* - testability of controllers
* - dependency injection for controllers via $inject and constructor function
* - $cookieStore for persistent cookie-backed storage
- * - simple templating constructs such as ng:repeat and {{}}
+ * - simple templating constructs such as ng-repeat and {{}}
* - date filter
* - and binding onSubmit and onClick events to angular expressions
* @author Igor Minar
*/
-
-/** @namespace the 'example' namespace */
-var example = example || {};
-/** @namespace namespace of the personal log app */
-example.personalLog = {};
-
-
//name space isolating closure
(function() {
+var app = angular.module('personalLog', ['ngCookies']);
+
var LOGS = 'logs';
/**
* The controller for the personal log app.
*/
-function LogCtrl($cookieStore, $scope) {
+app.controller('LogCtrl', ['$cookieStore', '$scope', function LogCtrl($cookieStore, $scope) {
var logs = $scope.logs = $cookieStore.get(LOGS) || []; //main model
@@ -72,11 +67,6 @@ function LogCtrl($cookieStore, $scope) {
logs.splice(0, logs.length);
$cookieStore.remove(LOGS);
};
-}
-
-//inject
-LogCtrl.$inject = ['$cookieStore', '$scope'];
+}]);
-//export
-example.personalLog.LogCtrl = LogCtrl;
})();