This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
docs/content/error/$compile Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ @ngdoc error
2+ @name $compile:noslot
3+ @fullName No matching slot in parent directive
4+ @description
5+
6+ This error occurs when declaring a specific slot in a {@link ng.ngTransclude `ngTransclude`}
7+ which does not map to a specific slot defined in the transclude property of the directive.
8+
9+ In this example the template has declared a slot missing from the transclude definition.
10+ This example will generate a noslot error.
11+ ```js
12+ var componentConfig = {
13+ template: '<div>' +
14+ '<div ng-transclude="slotProvided"></div>' +
15+ '<div ng-transclude="noSlotProvided"></div>' +
16+ '</div>',
17+ transclude: {
18+ // The key value pairs here are considered "slots" that are provided for components to slot into.
19+ slotProvided: 'slottedComponent', // mandatory transclusion
20+ // There is no slot provided here for the transclude 'noSlotProvided' declared in the above template.
21+ }
22+ };
23+ ```
24+
25+ If we make the following change we will no longer get the noslot error.
26+ ```js
27+ var componentConfig = {
28+ template: '<div>' +
29+ '<div ng-transclude="slotProvided"></div>' +
30+ '<div ng-transclude="noSlotProvided"></div>' +
31+ '</div>',
32+ transclude: {
33+ slotProvided: 'slottedComponent',
34+ noSlotProvided: 'otherComponent' // now it is declared and the error should cease
35+ }
36+ };
37+
38+ ```
You can’t perform that action at this time.
0 commit comments