aboutsummaryrefslogtreecommitdiffstats
path: root/src/widget/form.js
diff options
context:
space:
mode:
authorVojta Jina2011-11-29 21:51:59 -0800
committerVojta Jina2012-01-23 11:05:36 -0800
commit992c790f0786fa45c1cc3710f29bf49c7c322ba7 (patch)
tree581d06ea9ba275a14d5891d83b2df03f9930bd45 /src/widget/form.js
parentf5343c9fd3c7cd0fefdb4d71d2b579dbae998d6a (diff)
downloadangular.js-992c790f0786fa45c1cc3710f29bf49c7c322ba7.tar.bz2
refactor(scope): separate controller from scope
Controller is standalone object, created using "new" operator, not messed up with scope anymore. Instead, related scope is injected as $scope. See design proposal: https://docs.google.com/document/pub?id=1SsgVj17ec6tnZEX3ugsvg0rVVR11wTso5Md-RdEmC0k Closes #321 Closes #425 Breaks controller methods are not exported to scope automatically Breaks Scope#$new() does not take controller as argument anymore
Diffstat (limited to 'src/widget/form.js')
-rw-r--r--src/widget/form.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widget/form.js b/src/widget/form.js
index 49e3a545..f3134db4 100644
--- a/src/widget/form.js
+++ b/src/widget/form.js
@@ -52,8 +52,8 @@
<doc:example>
<doc:source>
<script>
- function Ctrl() {
- this.text = 'guest';
+ function Ctrl($scope) {
+ $scope.text = 'guest';
}
</script>
<div ng:controller="Ctrl">