aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/compile/nonassign.ngdoc
diff options
context:
space:
mode:
authorMisko Hevery2013-08-01 15:39:22 -0700
committerIgor Minar2013-08-08 14:33:16 -0700
commit78a445fa375400a2ced5383b485f26fc0ae363d2 (patch)
tree6a918f1da36b463b87a686dce1384bc77bc433ea /docs/content/error/compile/nonassign.ngdoc
parent4e76d0469ec4be3d704e8b2c3a98748357e93232 (diff)
downloadangular.js-78a445fa375400a2ced5383b485f26fc0ae363d2.tar.bz2
docs(compile/notassign): description for compile/notassign error
Closes #3459
Diffstat (limited to 'docs/content/error/compile/nonassign.ngdoc')
-rw-r--r--docs/content/error/compile/nonassign.ngdoc36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/content/error/compile/nonassign.ngdoc b/docs/content/error/compile/nonassign.ngdoc
new file mode 100644
index 00000000..f3c4dd2c
--- /dev/null
+++ b/docs/content/error/compile/nonassign.ngdoc
@@ -0,0 +1,36 @@
+@ngdoc error
+@name $compile:nonassign
+@fullName Non-Assignable Expression
+@description
+
+This error occurs when a directive defines an isolate scope property that support two-way data-binding (using the `=` mode in the {@link guide/directive#directivedefinitionobject directive definition}) but the directive is used with an expression that is not-assignable.
+
+In order for the two-way data-binding to work, it must be possible to write new values back into the path defined with the expression.
+
+For example, given a directive:
+
+```
+myModule.directive('myDirective', function factory() {
+ return {
+ ...
+ scope: {
+ 'bind': '=localValue'
+ }
+ ...
+ }
+});
+```
+
+Following are invalid uses of this directive:
+```
+<my-directive bind="1+2"> <!-- ERROR because `1+2=localValue` is an invalid statement -->
+<my-directive bind="myFn()"> <!-- ERROR because `myFn()=localValue` is an invalid statement -->
+```
+
+
+To resolve this error, always use path expressions with scope properties that are two-way data-bound:
+```
+<my-directive bind="some.property">
+<my-directive bind="some[3]['property']">
+```
+