aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/resource
diff options
context:
space:
mode:
authorChirayu Krishnappa2013-11-08 20:44:32 -0800
committerChirayu Krishnappa2013-11-11 16:17:34 -0800
commit9577702e8d2519c1a60f5ac4058e63bd7b919815 (patch)
tree69a063c50e1b575a77d86abec1587a74d07cc3fd /docs/content/error/resource
parenta61b65d01b468502fe53d68818949d3fcc9f20f6 (diff)
downloadangular.js-9577702e8d2519c1a60f5ac4058e63bd7b919815.tar.bz2
fix($resource): don't use $parse for @dotted.member
params and paramDefaults support looking up the parameter value from the data object. The syntax for that is `@nested.property.name`. Currently, $resource uses $parse to do this. This is too liberal (you can use values like `@a=b` or `@a | filter` and have it work - which doesn't really make sense). It also puts up a dependency on $parse which is has restrictions to secure expressions used in templates. The value here, though a string, is specified in Javascript code and shouldn't have those restrictions.
Diffstat (limited to 'docs/content/error/resource')
-rw-r--r--docs/content/error/resource/badmember.ngdoc27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/content/error/resource/badmember.ngdoc b/docs/content/error/resource/badmember.ngdoc
new file mode 100644
index 00000000..4a61eb9b
--- /dev/null
+++ b/docs/content/error/resource/badmember.ngdoc
@@ -0,0 +1,27 @@
+@ngdoc error
+@name $resource:badmember
+@fullName Syntax error in param value using @member lookup
+@description
+
+Occurs when there is a syntax error when attempting to extract a param
+value from the data object.
+
+Here's an example of valid syntax for `params` or `paramsDefault`:
+
+````javascript
+{
+ bar: '@foo.bar'
+}
+````
+
+The part following the `@`, `foo.bar` in this case, should be a simple
+dotted member lookup using only ASCII identifiers. This error occurs
+when there is an error in that expression. The following are all syntax
+errors
+
+ | Value | Error |
+ |---------|----------------|
+ | `@` | Empty expression following `@`. |
+ | `@1.a` | `1` is an invalid javascript identifier. |
+ | `@.a` | Leading `.` is invalid. |
+ | `@a[1]` | Only dotted lookups are supported (no index operator) |