0864f73458
Related to #16303 Closes #16306
37 lines
851 B
Plaintext
37 lines
851 B
Plaintext
@ngdoc error
|
|
@name $compile:missingattr
|
|
@fullName Missing required attribute
|
|
@description
|
|
|
|
This error may occur only when {@link $compileProvider#strictComponentBindingsEnabled `$compileProvider.strictComponentBindingsEnabled`} is set to `true`.
|
|
|
|
If that is the case, then all {@link $compileProvider#component component} controller bindings and
|
|
{@link $compileProvider#directive directive} scope / controller bindings that are non-optional,
|
|
must be provided when the directive is instantiated.
|
|
|
|
To make a binding optional, add '?' to the definition.
|
|
|
|
## Example:
|
|
|
|
```js
|
|
|
|
app.component('myTest', {
|
|
bindings: {
|
|
first: '=?', // optional
|
|
second: '='
|
|
},
|
|
controller: function() {
|
|
...
|
|
},
|
|
template: '...'
|
|
});
|
|
|
|
```
|
|
|
|
This component will throw `missingattr` for the `second` binding when used as follows:
|
|
|
|
```html
|
|
<my-test></my-test>
|
|
```
|
|
|