You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/error/$compile/missingattr.ngdoc
+33-3
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,36 @@
3
3
@fullName Missing required attribute
4
4
@description
5
5
6
-
This error may occur only when `$compileProvider.strictComponentBindingsEnabled` is set to `true`.
7
-
Then all attributes mentioned in `bindings` without `?` must be set. If one or more aren't set,
8
-
the first one will throw an error.
6
+
This error may occur only when {@link $compileProvider#strictComponentBindingsEnabled `$compileProvider.strictComponentBindingsEnabled`} is set to `true`.
7
+
8
+
If that is the case, then all {@link $compileProvider#component component} controller bindings and
9
+
{@link $compileProvider#directive directive} scope / controller bindings that are non-optional,
10
+
must be included when the directive is used.
11
+
12
+
To make a binding optional, add '?' to the definition.
13
+
14
+
### Example:
15
+
16
+
```js
17
+
18
+
app.component('myTest', function() {
19
+
return {
20
+
bindings: {
21
+
first: '=?', // this one is optional
22
+
second: '='
23
+
},
24
+
controller: function() {
25
+
...
26
+
},
27
+
template: '...'
28
+
}
29
+
});
30
+
31
+
```
32
+
33
+
This component will throw `missingattr` when used as follows:
0 commit comments